Move controls when form maximized

  • Thread starter Thread starter Jacob Thastrup
  • Start date Start date
J

Jacob Thastrup

Hi
This is propably easy to answer but how do I make sure that my controls
stay in a certain area of my form. Right now if I maximize my form the
controls will stay in their original position and the form will expand
all around it, how can I make my controls stay, say in the bottom right
corner no matter the size of the form and the resolution of the monitor?

Thanks

Jacob Thastrup
 
Take a look at the Anchor property of the controls. This will allow you to
'anchor' your controls in a particular position on the form. If you set the
Anchor property to Top, your control will be anchored to the top of the form
no matter the size of the form. Similarly, if you set the property to Bottom
Or Left (since these are bit flags), the control will be anchored to the
bottom left of the form. Based on your requirements, a particular
combination of the flags should work for you.

hope that helps..
Imran.
 
Jacob Thastrup said:
This is propably easy to answer but how do I make sure that my controls
stay in a certain area of my form. Right now if I maximize my form the
controls will stay in their original position and the form will expand
all around it, how can I make my controls stay, say in the bottom right
corner no matter the size of the form and the resolution of the monitor?

Take a look at the controls' 'Anchor' and 'Dock' properties, and the form's
'Scale' property. If you are looking for implementations of layout managers
like in Java, have a look here:

Simple Layout Managers
<URL:http://www.dotnet.jku.at/projects/slm/>
 
Works like a charm

Thanks

Imran said:
Take a look at the Anchor property of the controls. This will allow you to
'anchor' your controls in a particular position on the form. If you set the
Anchor property to Top, your control will be anchored to the top of the form
no matter the size of the form. Similarly, if you set the property to Bottom
Or Left (since these are bit flags), the control will be anchored to the
bottom left of the form. Based on your requirements, a particular
combination of the flags should work for you.

hope that helps..
Imran.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top