打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
WPF 倒三角按钮
<Button Width="10" HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="Button1" Template="{DynamicResource ButtonControlTemplate1}" Cursor="Hand" Height="12" Margin="0,0,5,2">
                                            <Button.Resources>
                                                <ControlTemplate x:Key="ButtonControlTemplate1" TargetType="{x:Type Button}">


                                                    <Polygon x:Name="ButtonPolygon" Stretch="Fill" Points="0,50,600,50 290,100" Stroke="White" StrokeThickness="0">  //Points 是调整三角形的样子
                                                        <Polygon.Fill>
                                                            <SolidColorBrush Color="Gray" Opacity="0.5"/>
                                                        </Polygon.Fill>
                                                    </Polygon>

                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="IsMouseOver" Value="True">
                                                            <Setter TargetName="ButtonPolygon" Property="Fill" Value="Black"></Setter>
                                                        </Trigger>
                                                        <Trigger Property="IsPressed" Value="True">
                                                            <Setter TargetName="ButtonPolygon" Property="Fill" Value="Gray"/>
                                                        </Trigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                            </Button.Resources>
                                        </Button>

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
button 鼠标移上下、不可用 变化图片
WPF XAML 为项目设置全局样式
WPF自定义控件与样式(7)
继续聊WPF——自定义CheckBox控件外观
WPF 详解模板
闲话WPF之二五(WPF中的ControlTemplate [3])
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服