Reflection and Form child Controls

  • Thread starter Thread starter Jon Turner
  • Start date Start date
J

Jon Turner

My intention is to be able to open an assembly and for each form, list the
form's children's controls. Can someone
please tell me how this can be accomplished ? I am familiar with how to get
Methods/properties using reflection, but
seem to be in the dark about the form's children's controls.

Many Thanks in Advance
 
The Form class, which inherits from the Control class, has a Controls
collection, so you can retrieve them recursively. This will work for most
controls (including forms), although for some controls it would be better to
use the Children property of the new ITreeDesigner interface of .NET 2.0,
but for this you need the designer, you can´t use Reflection.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top