using System; using System.Windows.Forms; namespace EncryptPad { public partial class Form2 : Form { public static bool formClosing = false; public Form2() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { MainWindow.key = textBox1.Text; textBox1.Focus(); textBox1.Text = ""; this.Hide(); } private void textBox1_TextChanged(object sender, EventArgs e) { if (textBox1.Text.Length > 0) button1.Enabled = true; else button1.Enabled = false; } private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { button1_Click(sender, e); } } private void pictureBox1_Click(object sender, EventArgs e) { if (textBox1.UseSystemPasswordChar == true) { textBox1.UseSystemPasswordChar = false; return; } if (textBox1.UseSystemPasswordChar == false) { textBox1.UseSystemPasswordChar = true; return; } } } }