这是一个非常简单的例子如何更改wpf中组件的属性?
我想点击该按钮,然后改变自身位置
在Visual Studio提示我这是一个公共属性,类型为双。为什么我不能改变价值?它并没有提供任何方法让我更改顶级属性,所以我如何更改属性?
<Button Content="Button" Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="0,0,0,0" Name="Button1" VerticalAlignment="Top" Width="75" Grid.Row="1" />
MsgBox(Button1.Margin.Top)
Button1.Margin.Top = 10
通过乔恩斯基特在这里找到答案: http://stackoverflow.com/questions/1003772/whats-the-problem-with-this-code –