I am trying to iterate through the textboxes in my window so I can make operations on them. Here is my code:
foreach (Control c in Controls)
{
if (c is System.Windows.Forms.TextBox)
{
MessageBox.Show(c.Name);
}
}
I have put a breakpoint on the line with if
, my program reaches that breakpoint, but it doesn't reach the MessageBox
line... Where is the error? (I tested this with c is Button
and it worked...)