Click here to Skip to main content
15,905,420 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dears,
I need a method to return all named controls in form
that declared in the InitializeComponent.
please help.
Posted

1 solution

Why? Have you looked at the Form.Controls array? You might find it contains what you need already...
 
Share this answer
 
Comments
maleksafadi 11-Sep-11 1:53am    
I tried this before, but this way does not return some of controls like:
child of menustrip.
OriginalGriff 11-Sep-11 3:26am    
Then all you have to do is recurse through the Controls array of the controls you find...
maleksafadi 11-Sep-11 10:06am    
but the problem is the items of menustrip is not controls
its items.
maleksafadi 14-Sep-11 10:48am    
but the problem is the items of menustrip is not controls its items.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900