I want to make a TextBox’s Text display like a PasswordBox’s Text. Is there any way by which I can do it? I think styling the TextBox may work. I tried to style it using PasswordBox’s default style (http://msdn.microsoft.com/en-us/library/dd334412.aspx) but it didn’t work.
Share
Use an
IValueConverterin wich you replace each character in theTextvariable of your TextBox with a*, then put the resulting string of stars in the tag property of your TextBox.This way, your textbox is not showing the actual string edited (which is a password here if i understood you right).
In your binding, put
UpdateSourceTrigger="PropertyChanged"to get it updated on every key instead of on LostFocus. Then bind the text displayed to theTextBox.Tagproperty.