W
W
WSGlebKavash2021-12-07 19:50:22
WPF
WSGlebKavash, 2021-12-07 19:50:22

How to show password in PasswordBox?

In <PasswordBox>WPF, the characters you enter are displayed as dots, so you can create forms with authorization. However, the element <PasswordBox>does not contain an argument responsible for displaying the password.
How to show the password in <PasswordBox>?

Temporary solution:
<StackPanel Orientation="Horizontal">
        <TextBlock Text="Пароль:" Width="90" FontSize="24"></TextBlock>
        <WindowsFormsHost Width="250" FontSize="24" Height="35">
          <form:TextBox x:Name="Tbx_Password" PasswordChar="●"></form:TextBox>
        </WindowsFormsHost>
        <ToggleButton x:Name="Btn_HideShow" Height="35" Width="35" Click="Btn_HideShow_Click"></ToggleButton>
</StackPanel>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sergey, 2021-12-07
@WSGlebKavash

Windows Forms had a PasswordChar property
documentation says
https://docs.microsoft.com/en-us/dotnet/api/system...
set it to '0' (U+0000) to not mask what the user is typing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question