dotnetmonitor.com

 
Index
Previous
Next

 

The simple answer is this is not possible. When you set an anchor, the dock style clears. And vise versa if you set the dock style. Under the covers, we use the same bit fields to represent dock and anchor, so it is not possible to get into a conflicting state.

Anchor Scenarios

These scenarios are in a form which employs a dock and anchor layout engine.

 

Keeping a fixed distance from an edge If you have a control you want to remain a fixed distance from an edge of the parent.

 

Anchor Bottom|Right

 

Resizing a child control when the parent grows/shrinks If you have a control you want to resize when the parent resizes using opposite anchors (Left | Right) or (Top | Bottom) will help maintain the same distance from the edge as the parent resizes.

 

Anchor = Top|Bottom Anchor = Left|Right

 

Terms
Docking Anchor Layout
Dock Scenarios
Padding Margin
You have a perf problem with Layout - how to diagnose?