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

Auto resize and position controls upon form's Resize even

P: n/a
Hi,
Are there any cool controls that would allow me to automatically resize
and repositions controls on my form when the form is resized at runtime?

Thanks in advance.

Mar 30 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a

Hi,
Are there any cool controls that would allow me to automatically resize
and repositions controls on my form when the form is resized at runtime?

Thanks in advance.
Mar 30 '06 #2

P: n/a
Look at the Dock and Anchor properties of your controls. They work in
..NET 1.1 and .NET 2.0.

In .NET 2.0 there are layout panels. Check out the Layout section of
the System.Windows.Forms namespace in .NET 2.0:

http://windowssdk.msdn.microsoft.com...dows_Forms.asp

Mar 30 '06 #3

P: n/a
Check the screen size when the application starts and based on the original
designed screen size, you can ratio the vertical and horizontals. Loop thru
all the controls and resize and relocate those that have the dock property
set to none.
--
Dennis in Houston
"Bruce Wood" wrote:
Look at the Dock and Anchor properties of your controls. They work in
..NET 1.1 and .NET 2.0.

In .NET 2.0 there are layout panels. Check out the Layout section of
the System.Windows.Forms namespace in .NET 2.0:

http://windowssdk.msdn.microsoft.com...dows_Forms.asp

Mar 31 '06 #4

P: n/a
Yes, that's the painful way to do it.

The first line of attack should be Dock and Anchor. In .NET 2.0 these
can be used in concert with layout containers like FlowLayoutPanel,
TableLayoutPanel, and SplitContainer.

If you cannot get the effect you want with a combination of these
things, then you have two choices, depending upon the situation:

1) Create your own layout container that does what you want. Lots of
work, but at least you can use it over and over in other projects.

2) Handle the Resize event on the Form and move and reshape your
controls accordingly.

If you have to resort to #2 in .NET 1.1 then that's life. If you have
to resort to #2 in .NET 2.0 then you really have to ask yourself if
it's worth getting that specific effect you're after (hint: it probably
isn't).

Mar 31 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.