473,508 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamically accessing control list of a form in dll controllibrary


Hi;

How can I get control list (Controls[]) of a form in a dll dynamically
activated using Activators.CreateInstance.
I need all controls names and attributes of one form which is in one dll.
Is it possible to do this ?

thanks in advance.
Nov 15 '05 #1
3 3155
Hi Ahmet,

You can do that using Reflection. Iterate on all types in the assembly in
question and check each type for having the System.Windows.Forms.Control as
its ascendant.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ahmet" <ak*********@hotmail.com> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...

Hi;

How can I get control list (Controls[]) of a form in a dll dynamically
activated using Activators.CreateInstance.
I need all controls names and attributes of one form which is in one dll.
Is it possible to do this ?

thanks in advance.


Nov 15 '05 #2
To add what dmitriry is saying...

Use the shared function of LoadFile (or whatever load you want) from
the System.Reflection.Assembly class

Iterate through Assembly.getTypes()

Also, check for the base type on most, because a lot of times you get
RuntimeMethod instead of method. but a runtime methods base type is
Method...

Just a little FYI.

-CJ

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:<uQ**************@TK2MSFTNGP10.phx.gbl>...
Hi Ahmet,

You can do that using Reflection. Iterate on all types in the assembly in
question and check each type for having the System.Windows.Forms.Control as
its ascendant.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ahmet" <ak*********@hotmail.com> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...

Hi;

How can I get control list (Controls[]) of a form in a dll dynamically
activated using Activators.CreateInstance.
I need all controls names and attributes of one form which is in one dll.
Is it possible to do this ?

thanks in advance.

Nov 15 '05 #3
To add what dmitriry is saying...

Use the shared function of LoadFile (or whatever load you want) from
the System.Reflection.Assembly class

Iterate through Assembly.getTypes()

Also, check for the base type on most, because a lot of times you get
RuntimeMethod instead of method. but a runtime methods base type is
Method...

Just a little FYI.

-CJ

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:<uQ**************@TK2MSFTNGP10.phx.gbl>...
Hi Ahmet,

You can do that using Reflection. Iterate on all types in the assembly in
question and check each type for having the System.Windows.Forms.Control as
its ascendant.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ahmet" <ak*********@hotmail.com> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...

Hi;

How can I get control list (Controls[]) of a form in a dll dynamically
activated using Activators.CreateInstance.
I need all controls names and attributes of one form which is in one dll.
Is it possible to do this ?

thanks in advance.

Nov 15 '05 #4

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

Similar topics

2
5788
by: Stephen Miller | last post by:
When I dynamically populate a HtmlSelect combo box, the Value property consistently fails to return the item selected, defaulting instead to the first item in the list. For example: Protected...
8
4297
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
2
2910
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have...
1
3108
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created...
2
1695
by: Vivek Sharma | last post by:
Hi There, I have a situation where I wish to load the controls dynamically on the basis of user role. Hence, I am using this code. if (UserRole == "IS Administrator") { Control UC1 =...
2
2053
by: Ahmet | last post by:
Hi; How can I get control list (Controls) of a form in a dll dynamically activated using Activators.CreateInstance. I need all controls names and attributes of one form which is in one dll. Is...
12
13131
by: vbnewbie | last post by:
I am having problems accessing properties of dynamically generated objects in VB2005. Can someone please help? In a nutshell: My app creates an equal number of checkboxes and labels that share the...
5
6743
by: Amoril | last post by:
I've read quite a few different message on various boards and for some reason I'm still having trouble wrapping my head around this viewstate maintenance and trying to get these dynamically created...
4
1476
by: imranabdulaziz | last post by:
Dear All, I am using asp.net2.0, C#, sql2005 using Visual studio 2005 Let Me explain the scenario I have checkboxlist containg 15 field. Based on no of checked field . I created...
0
7226
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,...
0
7328
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,...
0
7388
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...
0
5631
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,...
1
5055
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...
0
4709
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...
0
3199
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...
0
1561
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 ...
1
767
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.