Raoul_BennetH

Hi all Smile

On a form, i have a toolstripcontainer and some panels on it.

Im looking for a way to disable all the panel at once.

For example:

foreach(Panel p in myToolStripContainer)
{
p.Enabled = false;
}

Obviously, the above code doesnt work because toolstripcontainer do not contain a public definition for GetEnumerator.

Thank you at all in advance.

RaouL.



Re: Windows Forms Designer c# - disable panels on a toolstripcontainer

Martin Thorsen - MSFT

Hi,

You should be able to use:

foreach (Control c in myToolStripContainer)

{

c.Enabled = false;

}

Martin






Re: Windows Forms Designer c# - disable panels on a toolstripcontainer

Raoul_BennetH

Same error at compile time Sad




Re: Windows Forms Designer c# - disable panels on a toolstripcontainer

Martin Thorsen - MSFT

It worked fine for me.