try something like
void GetControls (Control c)
{
System.Console.WriteLine(c.GetType().Name);
foreach (Control child in c.Controls)
{
GetControls(child);
}
}in your form, call
GetControls(this);
void GetControls (Control c)
{
System.Console.WriteLine(c.GetType().Name);
foreach (Control child in c.Controls)
{
GetControls(child);
}
}in your form, call
GetControls(this);
i have solved my question with your method.
but i think if add some code to judge if child is container before GetControls(child), the efficiency maybe better,but i don't know how to,do you ? thank you!
i'm sorry,my english is not so good! :)
{
System.Console.WriteLine(c.GetType().Name);
if (c.Controls.Count > 0)
foreach (Control child in c.Controls)
{
GetControls(child);
}
}
i admire that not only your technology but also your English are so good,i want to make friends with you very much,OK?My email is :
[email protected], eager to receive your letter! :)
thank you again!