Anchoring is one of the ways that WinForms provides for automatic layout control of your forms and the controls contained therein. By default, all controls are anchored to the upper-left, so that as the form is resized and moved, all controls are kept at their position relative to the upper-left corner of the form. However, in this case, we'd clearly like to have the text box controls widen or narrow as the form is resized.
Without set right edge in anchor property
|
Before Re-sizing |
|
After Re-sizing |
To change the text boxes so that they anchor to the right edge as well as the top and left edges is a matter of clicking on the anchor rectangle on the right and changing the Anchor property to Top, Left, Right.
Set Top, Left and Right edge in anchor property
|
Before Re-sizing |
After set
|
After set re-sizing property |
Tidak ada komentar:
Posting Komentar