WPF TextBox使用密码样式

发布时间:2025-12-09 11:59:28 浏览次数:1

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

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

161458.html

textbox密码
需要做网站?需要网络推广?欢迎咨询客户经理 13272073477