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

加载中…