My goal is to disable all buttons (1 and 2) in groupbox1 (see the picture at the end). When I call the following Method DisableAllButtons(), only button 3 is disabled. What am i doing wrong?
private void DisableAllButtons()
{
try
{
foreach (Control c in Controls)
{
Button button = (Button)c;
button.Enabled = false;
}
}
catch
{
}
}