En iyi yanıtlayıcılar
textbox

Soru
-
Yanıtlar
-
iki textbox'un da Validated eventlerine aynı handleri ver, handler içinde
button1.Enabled == (textBox1.Text.Length == 0) && (textBox2.Text.Length == 0);
e-mail: onay[nokta]yalciner[at]hotmail[nokta]com
- Yanıt Olarak İşaretleyen Kyamuran SalibryamMicrosoft contingent staff, Moderator 23 Haziran 2016 Perşembe 14:30
-
private Button btn; private TextBox txt1; private TextBox txt2; void Main() { Form f = new Form(); btn = new Button {Top=10, Left=10, Enabled=false, Text="Pasif"}; txt1 = new TextBox {Top=60, Left=10}; txt2 = new TextBox {Top=90, Left=10}; txt1.TextChanged += (sender, args) => {EnableDisable();}; txt2.TextChanged += (sender, args) => {EnableDisable();}; f.Controls.AddRange(new Control[] {btn, txt1, txt2}); f.Show(); } private void EnableDisable() { btn.Enabled = txt1.Text == "" && txt2.Text == ""; }
- Yanıt Olarak İşaretleyen Kyamuran SalibryamMicrosoft contingent staff, Moderator 23 Haziran 2016 Perşembe 14:30
Tüm Yanıtlar
-
iki textbox'un da Validated eventlerine aynı handleri ver, handler içinde
button1.Enabled == (textBox1.Text.Length == 0) && (textBox2.Text.Length == 0);
e-mail: onay[nokta]yalciner[at]hotmail[nokta]com
- Yanıt Olarak İşaretleyen Kyamuran SalibryamMicrosoft contingent staff, Moderator 23 Haziran 2016 Perşembe 14:30
-
private Button btn; private TextBox txt1; private TextBox txt2; void Main() { Form f = new Form(); btn = new Button {Top=10, Left=10, Enabled=false, Text="Pasif"}; txt1 = new TextBox {Top=60, Left=10}; txt2 = new TextBox {Top=90, Left=10}; txt1.TextChanged += (sender, args) => {EnableDisable();}; txt2.TextChanged += (sender, args) => {EnableDisable();}; f.Controls.AddRange(new Control[] {btn, txt1, txt2}); f.Show(); } private void EnableDisable() { btn.Enabled = txt1.Text == "" && txt2.Text == ""; }
- Yanıt Olarak İşaretleyen Kyamuran SalibryamMicrosoft contingent staff, Moderator 23 Haziran 2016 Perşembe 14:30