mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Disabling Accept button when the textboxes are empty
This commit is contained in:
parent
8f84930b80
commit
6f4324cc78
2 changed files with 28 additions and 0 deletions
3
Crypto Notepad/ChangeKeyForm.Designer.cs
generated
3
Crypto Notepad/ChangeKeyForm.Designer.cs
generated
|
|
@ -50,6 +50,7 @@ private void InitializeComponent()
|
|||
this.textBox1.Size = new System.Drawing.Size(100, 20);
|
||||
this.textBox1.TabIndex = 0;
|
||||
this.textBox1.UseSystemPasswordChar = true;
|
||||
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
|
|
@ -58,6 +59,7 @@ private void InitializeComponent()
|
|||
this.textBox2.Size = new System.Drawing.Size(100, 20);
|
||||
this.textBox2.TabIndex = 1;
|
||||
this.textBox2.UseSystemPasswordChar = true;
|
||||
this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
|
|
@ -79,6 +81,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Enabled = false;
|
||||
this.button1.Location = new System.Drawing.Point(182, 82);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
|
|
|
|||
|
|
@ -66,5 +66,30 @@ private void ChangeKeyForm_Load(object sender, EventArgs e)
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
private void textBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (textBox1.Text.Length > 0 & textBox2.Text.Length > 0)
|
||||
{
|
||||
button1.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
button1.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void textBox2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (textBox1.Text.Length > 0 & textBox2.Text.Length > 0)
|
||||
{
|
||||
button1.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
button1.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue