Hello I was wondering how can I keep an eye on all textboxes
in Form whether in any of them was changed value. I saw some code here
private void Form1_Load(object sender, EventArgs e)
{
foreach (Control ctrl in this.Controls)
{
if (ctrl is TextBox)
{
TextBox tb = (TextBox)ctrl;
tb.TextChanged += new EventHandler(tb_TextChanged);
}
}
}
void tb_TextChanged(object sender, EventArgs e)
{
TextBox tb = (TextBox)sender;
tb.Tag = "CHANGED"; // or whatever
}
And a guy who wrote this code says that "it can't be assigned to textboxes in Panels and Grouboxes".
So my question is as I have almost every textbox in groubox or panel, how can I see whether change was made for textboxes in panels or groupbox?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…