I've been trying to change the FlatStyle for all Controls that support it in my form. However, I have multiple containers (panels) in it and code such as this just won't work:
foreach (object o in this.Controls)
if (o is ButtonBase)
(o as ButtonBase).FlatStyle = FlatStyle.Flat;
I thought a recursive method might help, but it somehow doesn't. I tried to look for another collection and check its controls as well, but it still doesn't work. Any sugestions?
Thanks.
There is nothing more dangerous than an idea when it is the only one you have.
foreach (object o in this.Controls)
if (o is ButtonBase)
(o as ButtonBase).FlatStyle = FlatStyle.Flat;
I thought a recursive method might help, but it somehow doesn't. I tried to look for another collection and check its controls as well, but it still doesn't work. Any sugestions?
Thanks.
There is nothing more dangerous than an idea when it is the only one you have.