473,796 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can get windows usercontrols from RunTime ganerater Form


Nicholas Paldino
in my application a have an Windows form on that i place an Panel Control.
in Form
load event i ganerate an Form in Panel Control on Runtime then get an design
time
create user-control (textbox, 2 buttons) in Runtime Form Runtime Form may
be contain
more then 1 same or difreant User Controls.

i want to get all the User controls on that Runtime Form as i can use that
controls
the code which do that mean getting user-controls is in one User Controls
because
user-controls is main key to perform this in user-control i do other more
things

the senario which is i'm thinking is when the usercontrols are place on
RunTime form
in the last User Control is placeed on this then it get the it's Parent Form
that
should be RunTime Form then get all it's Child Controls which will be
User-controls
which are placed on it as we can use that all controls i think will woking
through
Reflecion

the problem i'm face that i cann't that RunTime Form and it's Childs control
as
workable
for handling events i place that body of event procedure that use that
through

userControls's control or some other way

Nov 30 '05 #1
1 1537
raj
if i understand correctly you are trying to get list of all controls in the
panel control

you can try the the controls list

this will traverse (loop) through all the controls

foreach (Control ctrl in myPanel.Control s)
{
//here you can see if its the control you need.
if(ctrl is myCustomControl One )
{
//take some action
}

}

hth

raj

"Mian Mahboob" <ys******@yahoo .com> wrote in message
news:eE******** ******@TK2MSFTN GP10.phx.gbl...

Nicholas Paldino
in my application a have an Windows form on that i place an Panel Control.
in Form
load event i ganerate an Form in Panel Control on Runtime then get an
design time
create user-control (textbox, 2 buttons) in Runtime Form Runtime Form may
be contain
more then 1 same or difreant User Controls.

i want to get all the User controls on that Runtime Form as i can use that
controls
the code which do that mean getting user-controls is in one User Controls
because
user-controls is main key to perform this in user-control i do other more
things

the senario which is i'm thinking is when the usercontrols are place on
RunTime form
in the last User Control is placeed on this then it get the it's Parent
Form that
should be RunTime Form then get all it's Child Controls which will be
User-controls
which are placed on it as we can use that all controls i think will woking
through
Reflecion

the problem i'm face that i cann't that RunTime Form and it's Childs
control as
workable
for handling events i place that body of event procedure that use that
through

userControls's control or some other way

Dec 1 '05 #2

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

Similar topics

1
2277
by: Kate | last post by:
Hi: I have a picturebox control, and at runtime various usercontrols are added to it to make a diagram. As dynamically added usercontrols, they are of type VBExtender. Is there a way to save the diagram as a .wmf file? (The diagram might extend beyond the confines of the actual picturebox on the screen.) I have seen examples of how to print all the controls in a picturebox
2
1436
by: Emma | last post by:
Hi, I'm developing a GUI with almost all Usercontrols. It's been working wonderfull up till a few weeks ago, and really crashed yesterday. Suddenly I can no longer add some of my usercontrols to any of the others (I've also tried to create new usercontrols and windowforms and add them to the new control, but that doesn't work any better). It's really frustrating since I've been able to add them and run the program before.
9
2825
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am facing. Please please help me to solve this as soon as possible. So here we go ... I am not able to take the screen shot of the windows form based "Smart
14
1827
by: RL Stevenson | last post by:
What is a reasonable way to manage a complex form with 5 or so tabs with 100 or more controls bound to 5-10 tables in a database? Pasting all those controls, datasets, data adapters directly onto the form resulted in an unwieldy file of nearly 10,000 lines of code. Seems like there must be a better way.
4
3893
by: Andrea Williams | last post by:
Does anyone know of some in depth documentation regarding how to add user controls programatically? I have a User Control, which has some basic html controls, and depending on the number selected in an HtmlSelect control's value, I need to put x number of forms (or usercontrol) on the page. I've added the control once to the ASPX, but how do I add more than one when needed to the page, then how do I rename the form names so that they are...
2
1774
by: Mark | last post by:
Hi, I am wanting to know if it is possible to embed a UserControl into a Page at runtime. What I am trying to do is allow a user to specify that they want a "contact form" or a "latest news" in their page by simply entering {contact form} or {latest news} in the HTML of their page. What I have is two asp.net user controls called ContactForm.ascx and LatestNews.ascx
11
5309
by: Crirus | last post by:
I need to derive the Windows.Forms.Control 2 times so I design a class like this Public Class BMControl Inherits System.Windows.Forms.UserControl Public Class MapControl Inherits BMControl
3
1527
by: YYZ | last post by:
I swear I've done my research, and now I was just hoping someone could explain this to me. I've got a base class (usercontrol) that I am using just as an interface. Meaning, I've defined several MustOverride subs in there, and also a public property. I'm going to inherit a bunch of usercontrols from this one superclass (terminology correct?) and then they all have to make sure they can respond to that set of functions that I've...
1
1267
by: Maya | last post by:
Hello everyone, I have a windows form that has 2 child usercontrols i created and added inside, control1 has a label that displays some text based on activities i do in control2, my question is how do i update the label text inside control1 from control2? previously i got around this issue by using properties and static variables but this doesn't work with form controls such as the label i have. Any solution would be highly...
0
9684
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
9530
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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
10236
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
10182
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,...
0
10017
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7552
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
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
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.