Re: All Controls On Form Without Using Recursion
- From: "DeveloperX" <nntpDev@xxxxxxxxxxxxx>
- Date: 2 Feb 2007 08:30:41 -0800
Oopsie indeed. I know how I missed it as well. I created the test
harness I used at work, with a couple of buttons, a panel and a button
on the panel, and cleverly dropped the button over the panel instead
of in it, so everything went blue :)
Well spotted, thanks for the correction :)
On 2 Feb, 12:41, Stefan Hoffmann <stefan.hoffm...@xxxxxxxxxx> wrote:
hi,
DeveloperX wrote:
private void button2_Click(object sender, EventArgs e)
{
System.Collections.Stack toDo = new Stack();
bool working = true;
Control current = null;
foreach (Control c in this.Controls)
{
toDo.Push(c);
}
while (working)
{
current = (Control)toDo.Pop();
Is here not a
toDo.Push(current);
missing?
foreach (Control c2 in current.Controls)
{
toDo.Push(c2);
}
current.BackColor = System.Drawing.Color.AliceBlue;
if (0 == toDo.Count)
{
working = false;
}
}
}
mfG
--> stefan <--
.
- Follow-Ups:
- Re: All Controls On Form Without Using Recursion
- From: DeveloperX
- Re: All Controls On Form Without Using Recursion
- References:
- All Controls On Form Without Using Recursion
- From: inpuarg
- Re: All Controls On Form Without Using Recursion
- From: inpuarg
- Re: All Controls On Form Without Using Recursion
- From: DeveloperX
- Re: All Controls On Form Without Using Recursion
- From: DeveloperX
- Re: All Controls On Form Without Using Recursion
- From: Stefan Hoffmann
- All Controls On Form Without Using Recursion
- Prev by Date: Re: ActiveX in DLL
- Next by Date: Re: Case Insensitive String Comparison?
- Previous by thread: Re: All Controls On Form Without Using Recursion
- Next by thread: Re: All Controls On Form Without Using Recursion
- Index(es):