Is there a way to resize a form in the designer without moving any anchored controls? I am using winforms in Visual Studio 2010.
You can resize individual controls, and you can resize multiple controls of the same or different kind, such as Button and GroupBox controls.
The Anchor Property determines how a control is automatically resized when its parent control is resized. It defines the position for the control on the form. When designing a form that can be resized at run-time, the controls on the form should resize and reposition accordingly.
Anchor refers to the position a control has relative to the edges of the form. A textbox, for example, that is anchored to the left edge of a form will stay in the same position as the form is resized. Docking refers to how much space you want the control to take up on the form.
By default, the controls on an Access form stay anchored to the upper-left corner of the form, and do not resize when you resize the form. To change this behavior, you can use the Anchoring command. For example, you can configure a text box so that it stretches down and to the right as the form becomes larger.
You have to know when it is okay to cheat. Open the form's Designer.cs file and edit the this.ClientSize property assignment. That changes the form size but doesn't affect the Location of controls anchored to the right or bottom.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With