【发布时间】:2014-04-20 13:48:31
【问题描述】:
我的表单中有这个组件:
textbox1
textbox2
textbox3
textbox4
button1
还有一个功能:
private void checkStatusTextBoxes()
{
button1.Enabled = ( (textbox1.Text.Length != 0) && (textbox2.Text.Length != 0) && (textbox3.Text.Lenght != 0) && (textbox4.Text.Length !=0));
}
我想在文本框中更改文本时检查它,给你:
private void textbox1_TextChanged(object sender, EventArgs e)
{
checkStatusTextBoxes();
}
我不会为每个文本框重复它,我会添加一个事件(?)。我该怎么做?
【问题讨论】:
-
为所有这些附加
textbox1_TextChanged事件处理程序。这很容易。
标签: c# textbox textchanged