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. This will cause the text boxes to resize as the form resizes, as shown in
Anchoring Text Boxes Top, Left, Right and Buttons Bottom, Right
The default anchoring is top-left, but those edges need not be a part of the anchoring settings at all. For example, notice that anchors the OK and Cancel buttons to the bottomright, as is customary with Windows dialogs. If instead of building a dialog-style form, you'd like to build a window-style form, anchoring is not your best bet. For example, suppose you're building an Explorer-style application, with a menu bar and toolbar on the top, a status bar on the bottom, and a tree view and a list view taking up the rest of the space as determined by a splitter between them. In that kind of application, anchoring won't do. Instead, you'll want docking. Docking allows you to "stick" any control on the edge of its container, the way a status bar is stuck to the bottom of a form. By default, most controls have the Dock property set to None (the default for the StatusBar control is Bottom). You can change the Dock property in the Property Browser by picking a single edge to dock to or to take up whatever space is left, as shown in
No comments:
Post a Comment