http://bbs.csdn.net/topics/350199978
如果在XAML里设置:
设置控件的 HorizontalAlignment="Stretch",VerticalAlignment="Stretch",且不要显式设置控件的Width和Height属性.
如果是在代码里设置:
1
2
3
|
Button btn = new Button(); btn.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; btn.VerticalAlignment = System.Windows.VerticalAlignment.Stretch; |