i just want to know how to list all panel objects without using for each loop and to prevent recursive procedure..
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In C#:
I used reflection since you wrote you don’t want recursive method, however not all panels in your form can be discovered like that. If you create your panels without define a class member (this could be done even in the designer), you won’t get it with this method.
Recursive method:
EDIT:
The above method is not optimized. It is creating too many lists and can’t be used as “lazy”. Here is another improved version: