*/
Are you blogging on PH? Get your free blog.

Other Views

corner
*/

WinForm FAQ - What is Control Docking

What does it mean by docking of controls?

Docking is the property of the control to attach itself to a particular edge of the window (or other containing control). You can either dock a control to an edge or to fill the available space in the parent control or window. Common examples of docking includes menu bar and toolbars which dock themselves at the top of the window so that they may remain at top regardless of the size and of the window.

In the figure below, we have docked the button to the top of the window



When the control is resized, the control remains stuck to the top of the window



(Does it remind you the famous outlook bar?)

You can define a control to have a fill dock property so that it may fill all the available space in the parent window or parent control. In the figure below, we have docked the tree view control at left and the list view control with fill docking property



When the form is resized, the tree view will remain at left (changing only its height and not width) while the list view will expand itself to the rest of the available space on the form



(Does it remind you the famous Windows Explorer?)

A control is not docked to any edge, by default.

Index
corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.