加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

WPFTextBox使用密码样式

(2023-08-14 12:12:46)
分类: c#c c

大家好,又见面了,我是你们的朋友全栈君。

WPF的Textbox 并没有password样式,可以手动更改

                <</span>TextBox Width="200" Margin="10,0,0,0" Text="{Binding appData.CurrentUser.LoginPwd}" Background="Transparent">
                    <</span>TextBox.Style>
                        <</span>Style TargetType="{x:Type TextBox}"> <</span>Setter Property="TextDecorations"> <</span>Setter.Value> <</span>TextDecorationCollection> <</span>TextDecoration> <</span>TextDecoration.Pen> <</span>Pen Brush="Black" DashCap="Round" EndLineCap="Round" StartLineCap="Round" Thickness="10"> <</span>Pen.DashStyle> <</span>DashStyle Dashes="0.0,1.2" Offset="0.6" /> <</span>/Pen.DashStyle> <</span>/Pen> <</span>/TextDecoration.Pen> <</span>TextDecoration.Location> <</span>TextDecorationLocation>Strikethrough<</span>/TextDecorationLocation> <</span>/TextDecoration.Location> <</span>/TextDecoration> <</span>/TextDecorationCollection> <</span>/Setter.Value> <</span>/Setter> <</span>Setter Property="Height" Value="30" /> <</span>Setter Property="Background" Value="#FF484D5E" /> <</span>Setter Property="Foreground" Value="Transparent" /> <</span>Setter Property="FontSize" Value="20" /> <</span>Setter Property="FontFamily" Value="Courier New" /> <</span>/Style>
                    <</span>/TextBox.Style>
                <</span>/TextBox>

转:https://cloud.tencent.com/developer/article/2107241?areaSource=102001.14&traceId=ffbMuylwojdBVTnsQOOri

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有