473,529 Members | 2,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reflection and Form child Controls

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
Nov 23 '05 #1
1 1581
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

"Jon Turner" <jj*@mail.com> escribió en el mensaje
news:O$**************@TK2MSFTNGP15.phx.gbl...
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

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
8418
by: samlee | last post by:
Hi All, I'm learning how to write C# using reflection, but don't know how to code using reflection this.Controls.Add(this.label1); Could anyone help, Thank in advance. xxx======================================================================
7
371
by: John | last post by:
I have a class the reads in a file and sets the values of the file into its properties. This class is used to populate the data onto a form. This form has controls created at runtime based on user input (file values when file is opened). I was hoping to put the name of the property in the tag of each control and fire an event if the a file...
8
4920
by: CJack | last post by:
hy, I have an mdi application, i create a child form and I want to know when a button is pressed while that child form is loaded. I have this code: private void frmTestBaby_KeyUp(object sender, System.EventArgs e) { MessageBox.Show("keyboard button pressed!"); } Following is the code to load the frmTestBaby
1
1750
by: Jon Turner | last post by:
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
11
1383
by: Simon Verona | last post by:
How can I write a line of code that sets an object to be an object thats contained on the parent form. Basically, I have a usercontrol, where one of the properties that I have added that can be entered at design time is an object name (on a windows form). I want to be able to set a variable to that object within the control so I can then...
5
2187
by: Skandy | last post by:
Hello All: My second post in as many days! I'm trying to get this working. I have a form and a user control and trying to add the user control to this form. Without reflection this would be achieved as Form.Controls.Add(objUserControl); Now in my code I have the following:
3
1250
by: John Wright | last post by:
How can I set the property of a loaded Assembly using reflection. My Shell program will log in a person and retrieve a list of all programs the person can use. When the shell program launches a program I use the following code: Dim extAssembly As System.Reflection.Assembly =...
2
1730
by: Peted | last post by:
I have 2 samples of code bellow that work fine at the moment the first routine loads an dll assembley and instantiates the type in the dll which is always a form, and creates a child form from it. I need to use latebinfing becasue the dll to be loaded is selected by the user but is allways a dll with a form class and always instantiated...
3
9644
by: Adam Right | last post by:
Hi, I am developing an application which has established on MDI Form and there are many MDI Child forms. My problem is starting when i close the mdi child forms. They are not disposed from the virtual memory, so it wastes much memory for the clients. I trigger GC.Collect and i also implemet IDisposable method for all object that i have...
6
2550
by: Ron | last post by:
I am building a utility that needs to extract all Windows forms control names from a compiled assembly for documentation purposes. I am currently using reflection, but not all of the controls are coming back. What should I be doing differently? Thanks, Ron private void Reflect(string AssemblyPath)
0
7338
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7665
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7250
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5799
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5193
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4830
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3326
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1713
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
898
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.