WinForms 中的锚==WPF 中的水平(+垂直)对齐?
在WPF中找不到锚点属性,它是否被重建为水平和垂直对齐? 是一样的吗? 我想在两侧(左右)扩展我的控制,但它的工作方式与锚定有很大不同
Can't find anchor property in WPF, was it reconstructed to Horizontal and Vertical Alignments?
Is it the same?
I wanted to stretch my control in both sides (right and left), but it worked rather different than anchor
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你可以像这样做 Anchor 的事情
You can do something like Anchor like this
Windows 窗体的 Anchor 和 Dock 属性被 WPF 中适当的布局容器所取代。根据您的具体需求,您应该能够使用 Grid 或 DockPanel 容器在 WPF 中创建所需的布局。
The Anchor and Dock properties of Windows Forms are replaced by appropriate layouting containers in WPF. Depending on what exactly you need you should be able to create your desired layout in WPF with the Grid or DockPanel containers.
控件的边缘有白色的小圆圈。单击它们,它们将转换为三角形,这意味着边缘被锚定。
There are small white circles at the edges of the control. Click them, and they will be converted to triangles which mean the edge is anchored.