Difference between Anchor and Dock properties? - preCharge Forums
It shows that you are unregistered. Please register with us by clicking Here
preCharge Forums


Nav Green LeftNav Right
preCharge Forums > Website Design & Development > Programming > .NET » Difference between Anchor and Dock properties?


Reply
Tcat Right
 
LinkBack Thread Tools Display Modes Tcat Right
Old 08-01-2006   #1 (permalink)
agaba175
Banned User
 
Join Date: Jul 2006
Location: India
Age: 29
Posts: 105
Default Difference between Anchor and Dock properties?

Difference between Anchor and Dock properties?
agaba175 is offline   Reply With Quote


Old 08-03-2006   #2 (permalink)
Nazir
Member
 
Join Date: Jul 2006
Age: 47
Posts: 45
Default Re: Difference between Anchor and Dock properties?

The Anchor and Dock properties manage the position and sizing of controls as the user changes the size of a form.

The Dock property is used to set a control to one of the four edges of the form -- Top, Bottom, Left, or Right -- to dock it to that edge. A docked control will always be positioned flush against the respective edge of it's container form. It's "opposite" size dimention will be modified to take up the entire width or height of the form. In other words, if you set a control's Dock property to Left, that control will always be positioned flush against the left edge of the form, and its height property will be automatically adjusted so that the control takes up the entire height pf the form.

One special value of the Dock property, Fill, causes all four edges of the control to be docked to all four edges of the form. This will always take up the entire inner area of the form.

The Anchor property, allows you to specify any (or all) of the four edges of a form to which you want to control to be anchored. Normally, a control's Anchor property is set to Top, Left, which means that the control's distance from the top and left edges of the form will remain constant, no matter how the form is resized. Changing the Anchor property to some other combination of edges, such as Top, Bottom, Left, will cause the conrol's distance from edges to remain constant as the form is resized. The control's location and size properties are adjusted as necessary to accomplish this.

One use of the Anchor property is to keep the size of an image constant relative to the size of the form containing it.

The Anchor and Dock properties cannot be used at the same time for the same control. If, for example, you set the Anchor property of a control to something other then its default value, and set its Dock property to Bottom, Left, for instance the control's Anchor property reverts to its default value of Top, Left.

When you want a control to remain positioned along one (or more) of the form's edge, use the Dock property. If you want a control's position inside the form (not docked to an edge) to remain constant, use the Anchor property.
Nazir is offline   Reply With Quote

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
A Site with a difference Rex All Things General 0 07-22-2006 11:13 AM
What is difference between MetaData and Manifest? agaba175 .NET 1 07-19-2006 02:08 PM


footer left
All times are GMT. The time now is 10:24 PM.

DISCLAIMER: preCharge Risk Management is not responsible for any opinions, advice or comments expressed on the preCharge Community Forums.
preCharge® is a registered trademark of preCharge Risk Management | chargeback protection | Merchant Account Blog

Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC6

Literatura fantastica | Free vBulletin Skins | Free Credit Report | Problem Mortgage | Credit Cards

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49