WPD-StackPanel中的控件水平居中
2016-03-14 08:52
274 查看
第一步:设定StackPanel的宽度 Width="100"
第二步:StackPanel中的子控件设定为 HorizontalAlignment="Center"
代码如下:
<StackPanel Orientation="Vertical" Width="100" Background="#FF49E23D" >
<Button Content="Button" Height="25" Name="button2" Width="75" HorizontalAlignment="Center" />
<Button Content="Button" Height="25" Name="button3" Width="75" HorizontalAlignment="Center"/>
<Button Content="Button" Height="25" Name="button4" Width="75" HorizontalAlignment="Center"/>
</StackPanel>
如果大家更好的方法,请与我联系!
第二步:StackPanel中的子控件设定为 HorizontalAlignment="Center"
代码如下:
<StackPanel Orientation="Vertical" Width="100" Background="#FF49E23D" >
<Button Content="Button" Height="25" Name="button2" Width="75" HorizontalAlignment="Center" />
<Button Content="Button" Height="25" Name="button3" Width="75" HorizontalAlignment="Center"/>
<Button Content="Button" Height="25" Name="button4" Width="75" HorizontalAlignment="Center"/>
</StackPanel>
如果大家更好的方法,请与我联系!
相关文章推荐
- 如何对磁盘分区进行写保护
- EWF-微软的“影子系统”
- Java中的异常测试框架JUnit使用上手指南
- ewf
- LeetCode-62-Unique Paths(动态规划)-Medium
- Android系统架构
- 初始化css状态
- PHP访问数据库集群的方法小结
- 杭电 2047 阿牛的EOF牛肉串 (递推)
- 网络应用程序架构
- FBWF
- 深度学习大牛主页
- Commit message 和 Change log 编写指南
- api图片传输,转成64位字符串进行传输
- 微信红包生成算法
- Java enum的用法详解
- java swing学习1-windowbuilder的安装
- c++对象模型
- 你值得拥有的CSS下拉菜单效果
- LightOJ 1067 - Combinations【Lucas定理】