Cadastrar
Login
Novo texto
Português
English
Português
Cadastrar
Login
Novo Texto
Importar Arquivo
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Lab07 { public partial class Form1 : Form { bool closable = true; bool trackBarEdible = true; int lastTrackBar = 0; public Form1() { InitializeComponent(); } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { string size = ((sender as ComboBox).SelectedItem as string); string[] tokens = size.Split('*'); int x = int.Parse(tokens[0]); int y = int.Parse(tokens[1]); this.Size = new Size(x, y); } private bool SizeFormatIsValid(string size) { bool wasAsterix = false; for (int i = 0; i < size.Length; i++) { if (size[i] == '*' && !wasAsterix) { wasAsterix = true; continue; } else if (size[i] == '*') { return false; } if (!Char.IsDigit(size[i])) { return false; } } return true; } private bool SizeFormatIsDulicate(string size) { foreach(object item in comboBox1.Items) { if (size.Equals(item as string)) return true; } return false; } private void PingFormatLabel() { label_format.ForeColor = Color.Red; Task.Factory.StartNew(() => { System.Threading.Thread.Sleep(1000); label_format.ForeColor = SystemColors.ControlText; }); } private void AddNewSize(string size) { if (!SizeFormatIsDulicate(size)) { if (SizeFormatIsValid(size)) { comboBox1.Items.Add(textBox1.Text); } else { PingFormatLabel(); } } textBox1.Text = ""; } private void Form1_KeyDown(object sender, KeyEventArgs e) { if (textBox1.Focused && e.KeyCode == Keys.Enter) { AddNewSize(textBox1.Text); e.SuppressKeyPress = true; } } private void radioButton_CheckedChanged(object sender, EventArgs e) { float size = 9 + int.Parse((sender as RadioButton).Tag as string) * 0.5f; this.Font = new Font("Segoe UI", size); } private void checkBox_a_CheckedChanged(object sender, EventArgs e) { bool toggle = (sender as CheckBox).Checked; this.ShowIcon = toggle; } private void checkBox_d_CheckedChanged(object sender, EventArgs e) { bool toggle = (sender as CheckBox).Checked; closable = !toggle; } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (!closable) e.Cancel = true; } private void checkBox_i_CheckedChanged(object sender, EventArgs e) { bool toggle = (sender as CheckBox).Checked; trackBarEdible = !toggle; } private void trackBar1_Scroll(object sender, EventArgs e) { TrackBar trackBar = (sender as TrackBar); if (!trackBarEdible) { trackBar.Value = lastTrackBar; return; } int value = trackBar.Value; lastTrackBar = value; panel1.Left = (Width - panel1.Width) * value / 10; } private void Form1_Load(object sender, EventArgs e) { ToolTip toolTop = new ToolTip(); toolTop.SetToolTip(comboBox1, "Выбрать размер формы"); toolTop.SetToolTip(textBox1, "Добавить размер формы. Enter для ввода"); toolTop.SetToolTip(groupBox1, "Выбрать размер шрифта"); toolTop.SetToolTip(radioButton1, "9 единиц измерения, заданных свойством Unit"); toolTop.SetToolTip(radioButton2, "9,5 единиц измерения, заданных свойством Unit"); toolTop.SetToolTip(radioButton3, "10 единиц измерения, заданных свойством Unit"); toolTop.SetToolTip(radioButton4, "10,5 единиц измерения, заданных свойством Unit"); toolTop.SetToolTip(radioButton5, "11 единиц измерения, заданных свойством Unit"); toolTop.SetToolTip(radioButton6, "11,5 единиц измерения, заданных свойством Unit"); toolTop.SetToolTip(checkBox_a, "Включить / Выключить иконку в верхнем левом углу формы"); toolTop.SetToolTip(checkBox_d, "Разрешает / Запрещает закрывать приложение"); toolTop.SetToolTip(checkBox1, "Разрешает / Запрещает двигать ползунок ниже"); toolTop.SetToolTip(panel1, "Панель, движение по горизонтали которой осуществляется ползунком"); toolTop.SetToolTip(trackBar1, "Осуществляет движение по горизонтали панели снизу"); } } }
Configurações do Texto
Título do Texto :
[Opcional]
Guardar na Pasta :
[Opcional]
Selecionar
Syntax Highlighting :
[Opcional]
Selecionar
Markup
CSS
JavaScript
Bash
C
C#
C++
Java
JSON
Lua
Plaintext
C-like
ABAP
ActionScript
Ada
Apache Configuration
APL
AppleScript
Arduino
ARFF
AsciiDoc
6502 Assembly
ASP.NET (C#)
AutoHotKey
AutoIt
Basic
Batch
Bison
Brainfuck
Bro
CoffeeScript
Clojure
Crystal
Content-Security-Policy
CSS Extras
D
Dart
Diff
Django/Jinja2
Docker
Eiffel
Elixir
Elm
ERB
Erlang
F#
Flow
Fortran
GEDCOM
Gherkin
Git
GLSL
GameMaker Language
Go
GraphQL
Groovy
Haml
Handlebars
Haskell
Haxe
HTTP
HTTP Public-Key-Pins
HTTP Strict-Transport-Security
IchigoJam
Icon
Inform 7
INI
IO
J
Jolie
Julia
Keyman
Kotlin
LaTeX
Less
Liquid
Lisp
LiveScript
LOLCODE
Makefile
Markdown
Markup templating
MATLAB
MEL
Mizar
Monkey
N4JS
NASM
nginx
Nim
Nix
NSIS
Objective-C
OCaml
OpenCL
Oz
PARI/GP
Parser
Pascal
Perl
PHP
PHP Extras
PL/SQL
PowerShell
Processing
Prolog
.properties
Protocol Buffers
Pug
Puppet
Pure
Python
Q (kdb+ database)
Qore
R
React JSX
React TSX
Ren'py
Reason
reST (reStructuredText)
Rip
Roboconf
Ruby
Rust
SAS
Sass (Sass)
Sass (Scss)
Scala
Scheme
Smalltalk
Smarty
SQL
Soy (Closure Template)
Stylus
Swift
TAP
Tcl
Textile
Template Toolkit 2
Twig
TypeScript
VB.Net
Velocity
Verilog
VHDL
vim
Visual Basic
WebAssembly
Wiki markup
Xeora
Xojo (REALbasic)
XQuery
YAML
HTML
Expiração do Texto :
[Opcional]
Nunca
Auto Destruir
10 Minutos
1 Hora
1 Dia
1 Semana
2 Semanas
1 Mês
6 Meses
1 Ano
Status do Texto :
[Opcional]
Público
Não Listado
Privado (somente membros)
Senha :
[Opcional]
Descrição:
[Opcional]
Tags:
[Opcional]
Criptografar Texto
(
?
)
Criar Novo Texto
No momento você não está logado, isso significa que você não pode editar ou excluir nada que você poste.
Cadastre-se
ou faça o
Login
Idiomas do site
×
English
Português
Você gosta de cookies?
🍪 Usamos cookies para garantir que você obtenha a melhor experiência em nosso site.
Saber mais
Concordo