471,306 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 software developers and data experts.

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 1432
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.Controls)
{
//here you can see if its the control you need.
if(ctrl is myCustomControlOne )
{
//take some action
}

}

hth

raj

"Mian Mahboob" <ys******@yahoo.com> wrote in message
news:eE**************@TK2MSFTNGP10.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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by RL Stevenson | last post: by
4 posts views Thread by Andrea Williams | last post: by
3 posts views Thread by YYZ | last post: by
1 post views Thread by Maya | last post: by
reply views Thread by rosydwin | last post: by

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.