473,670 Members | 2,331 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 17 '05 #1
1 1755
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$******** ******@TK2MSFTN GP15.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 17 '05 #2

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

Similar topics

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 is open when the control is created and use the tag to get the correct property from the class. ...
8
4930
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
11
1392
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 manipulate it.
1
1588
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
5
2191
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
1253
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 = System.Reflection.Assembly.LoadFrom("D:\testload\TestLoad\TestLoad\bin\Debug\testload.exe") Dim extForm As Form = extAssembly.CreateInstance("TestLoad.form1",...
2
1734
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 as a child form. My problem is how can using this technique pass a reference to the
3
9663
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 created. But when i use a memory profiler that shows the status of the current object for my...
6
2556
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
8471
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8907
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8817
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8593
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
6218
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5687
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4215
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2804
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

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.