开发者

Docking and Anchoring is missing in WPF

i did not found the control's property called dock and anchor. if it is not there then how we can have the flavor of doc开发者_Python百科k and anchor property of every control. here how could i set a controls dock property to Top. please discuss.

thanks


'Docking' in WPF can be done by Setting the HorizontalAllignment and the VerticalAllignment properties of a child control.

An alternative is nesting the control in a DockPanel and setting the DockPanel.Dock to e.g. Top on the control.l:

<DockPanel>
    <TextBlock DockPanel.Dock="Top" />
</DockPanel>

'Anchoring' in WPF can be done by setting the Margin on the child and/or the Padding on the container.


i think you are getting at layout differences. The wpf framework works more on it's containers. take a look at this section for more help http://www.wpftutorial.net/Layout.html


check out AvalonDock on CodePlex, it's awesome and free!

here's a link to getting started

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜