对齐控制如何控制到右下角? [英] How alignment control to right-bottom?
问题描述
<Canvas>
<Button Content="{Binding DisplayText}" Canvas.Left="{Binding Offset.X}" Canvas.Top="{Binding Offset.Y}">
</Button>
</Canvas>
我希望按钮的右下角点位于画布的偏移位置,左上角点可能因为按钮的大小是动态
I want the button's right-bottom point at Offset in canvas, the Left-Top point may bey changed because the button's size is dynamic
推荐答案
嗨 回想游仙,
Hi 迴梦游仙,
>>我希望按钮的右下角点位于画布的偏移位置,左上角点可能会因为按钮的大小是动态的而改变
画布将允许您将控件放入其中,然后使用显式坐标自行定位。对于右下角按钮,您可以使用右侧和底部将它们推向右下方向。
The canvas will allows you to put controls in it and then position them yourself using explicit coordinates. For the right-bottom buttons, you can use the Right and Bottom to push them towards the right-bottom directions.
更详细,请参阅
Canvas附加属性
for more detailed, see
Canvas Attached Properties
<Canvas >
<Button Content="show test" Canvas.Bottom="{Binding Offset.X}" Canvas.Right="{Binding Offset.Y}" VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="26">
</Button>
</Canvas>
如果我有任何误解,您可以包含所有必要的代码段,供人们重现您的问题。
If I have any misunderstanding, you can include all necessary code snippets for people to reproduce your issue.
感谢您的理解。
最好的问候,
Thank you for your understanding.
Best Regards,
Yong Lu
这篇关于对齐控制如何控制到右下角?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!