【发布时间】:2014-05-31 11:00:02
【问题描述】:
我有一个 WrapPanel 和三个按钮。 WrapPanel 中的第三个按钮位于第二行。 我想找到button4的真实位置。
<WrapPanel Height="100" Width="200">
<Button Content="Button" Height="23" Name="button2" Width="75" />
<Button Content="Button" Height="23" Name="button3" Width="75" />
<Button Content="Button" Height="23" Name="button4" Width="75" />
</WrapPanel>
我使用此代码,但它为 0,因为边距为 0。
int top = button4.Margin.Top //I want in this case top become 23 but it is 0.
【问题讨论】: