Click here to Skip to main content
14,699,500 members
Please Sign up or sign in to vote.
4.38/5 (5 votes)
See more:
hi friends

i want to use textbox as password box in wpf. we have password box seperately but i need it in same textbox iteself. want to change the character as ex(*) in textbox itself please help me out.
Updated 9-Apr-12 21:34pm

The right solution is:

<passwordbox x:name="txtPassword" xmlns:x="#unknown">
Nivas Maran 10-Apr-12 2:25am
i am creating user control which accept textbox and password box in wpf you are giving solution in password box but i want to change character as * in textbox
Clifford Nelson 10-Apr-12 11:03am
I am not sure what your question is. You can easily change the PassworkChar, if that is the problem, by changing the attribute value from "*". If you want both a password box and a textbox, then would overlay the two, and set the visibility of one to hidden.
Nuzz604 13-Aug-14 15:51pm
Finally, a correct answer here. Don't understand why they downvoted it. Guess there are a lot of lousy coders on this site.
select text box,right click,select property ;in property window;in "text mode" option

select password.
Nivas Maran 10-Apr-12 1:42am
there is no textmode option in wpf textbox
Clifford Nelson 10-Apr-12 2:17am
There is no TextMode for a TextBox in WPF.
<asp:textbox id="pwdtxt" runat="server" textmode="Password" xmlns:asp="#unknown">
Nivas Maran 10-Apr-12 1:43am
i want textbox as password box in wpf
Clifford Nelson 10-Apr-12 2:17am
This is not right for WPF. Looks like ASP.NET
Arul R Ece 10-Apr-12 4:21am
Ya sorry friend....It is for .....

set textmode property as "Password".
Clifford Nelson 10-Apr-12 2:17am
There is no TextMode for a TextBox in WPF.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900