<StackPanel>
<Button Margin="5" Content="Sample Button" Background="{StaticResource myBrush}" Height="83" Width="151" />
<Rectangle Margin="5" Width="100" Height="100" Fill="{StaticResource myBrush}" />
</StackPanel>
上面的代码,为什么我在StackPanel中拖动Button或者Rectangle,不能随心所欲的移动位置呢,要弹回去呢?不像winform中的Panel,可以随意放置位置。
刚刚学WPF,还请前辈指点,谢谢!!!
<Button Margin="5" Content="Sample Button" Background="{StaticResource myBrush}" Height="83" Width="151" />
<Rectangle Margin="5" Width="100" Height="100" Fill="{StaticResource myBrush}" />
</StackPanel>
上面的代码,为什么我在StackPanel中拖动Button或者Rectangle,不能随心所欲的移动位置呢,要弹回去呢?不像winform中的Panel,可以随意放置位置。
刚刚学WPF,还请前辈指点,谢谢!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货