I know this is an old question, but it is relevant to what I am looking for and I felt like commenting on it.
I sure don't see how that helps. It does not resize anything
jmcilhinney wrote:
If you do want to move/resize controls with the window you need to use their Anchor property. You can anchor them to any or all edges of the form, so their distance from that edge will be constant regardles of the form size.
'jmcilhinney' how do you know this guy hasnt done any investigation into how this task is done?. I spent half a day looking into how this was done and overlooked it myself. Not a very friendly approach to a polite question.
1. Select the control on the form that you wish to resize.
2. Go to the anchor properties for that control in the soloution explorer.
3. Change the anchor points from 'Top, Left' (Default Value) to 'Top, Left, Bottom, Right'
The control will then resize itself perfectly to the size of the form. You can apply anchoring to as many controls as necessary but it does take a little trial and error.
Hi appolospb
I am having trouble with the anchor property and liked your approach and wondered if you could help me too. I have also spent many hours investigating but seem unable to find the anchor property. I am trying to anchor and dock a simple button in a web page. (I am new to VS so this is probably very basic and I am overlooking something)
If I click on the control - in this case just a button and look in the property window, it is not there - neither are any docking properties.
If I follow your instructions above :
1. Select the button on the form -
2. Where in the solution explorer am I supposed to see the anchor properties ?
I see the following files : App_Data
Default.aspx
Default.aspx.vb
web.config
What is set / not set which is not allowing me to see the anchor properties ?
I am using VS 2005
Thanks Andrea