By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,327 Members | 1,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,327 IT Pros & Developers. It's quick & easy.

Expanding user controls

P: n/a
I have a treeview and a panel inside of a form. Depending on what item in
the treeview is clicked, different user controls get loaded into the panel.
If the form is resized, or maximized the panel stretches with the form, but
the user controls stay static. Is there a way I can stretch the user
control forms automatically (as well as reposition all objects on the user
controls) when the size of the panel changes? Thanks for any advice.

-Jason
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I'm not sure if this is the best way to do it, but am I right in saying I
could just do something like:

Panel1.Controls.Item(0).Size = New Size(Panel1.Width, Panel1.Height)

in the main form, and handle the controls contained within the user controls
through each of the separate user control's resize event?

Is there a better way, or is that pretty much standard?

-Jason
"OpticTygre" <op********@adelphia.net> wrote in message
news:uv********************@adelphia.com...
I have a treeview and a panel inside of a form. Depending on what item in
the treeview is clicked, different user controls get loaded into the panel. If the form is resized, or maximized the panel stretches with the form, but the user controls stay static. Is there a way I can stretch the user
control forms automatically (as well as reposition all objects on the user
controls) when the size of the panel changes? Thanks for any advice.

-Jason

Nov 20 '05 #2

P: n/a

"OpticTygre" <op********@adelphia.net> wrote in message
news:rr********************@adelphia.com...
I'm not sure if this is the best way to do it, but am I right in saying I
could just do something like:

Panel1.Controls.Item(0).Size = New Size(Panel1.Width, Panel1.Height)
Why not just anchor the UserControl to all sides of the Panel?
in the main form, and handle the controls contained within the user controls through each of the separate user control's resize event?


This is definitely the way to go for controls in the UserControl itself.
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.