标签 标签 标签
- 一句话的事儿:完成对一个按钮的基本功能
逻辑介绍
- 创建一个按钮Button;
- 在按钮盒子中创建具体样式,通过Button.Template
- 按钮触发click事件;
源代码
<Button Width="150" Height="50" Click="Button_Click"><Button.Template><ControlTemplate><Grid><Rectangle Width="100" Height="50" Fill="Violet" RadiusX="25" RadiusY="25" Opacity="0.5"></Rectangle><TextBlock Text="按钮" TextAlignment="Center" VerticalAlignment="Center" FontSize="25" Foreground="Blue"></TextBlock></Grid></ControlTemplate></Button.Template></Button>
效果图


- 本文作者:GeekPower - Felix Sun
- 版权声明: 本博客所有文章除特别声明外,均采用 MIT 许可协议。转载请注明出处!
