Click here to Skip to main content
15,068,988 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi All,
I need some help about how to set the caret position in passwordBox..I could able to do in textBox but cant find any information about passwordBox properties..

For example,
I'm using virtual keyboard for the textBox and passwordBox..Everything is fine in textBox but when using passwordBox I couldn't get like Select(),SelectionStart,SelectedText like this..
Now I need if I keep the caret position at the middle, character should get type at that caret position,,if I delete the character at the caret position that particular caret position should be deleted..It should not be like (textBox.text.length - 1)..
Any further queries about this question Let me know..

Thanks in Advance,

1 solution

Yes, such properties are not exposed. It means this control is not really designed to do such things. Authors of the library envisioned much narrower functionality for this control.

Not to worry — use regular WPF TextBox. I'm sure you could easily hide the typed characters using some minimalistic trick. One approach is: handle PreviewTextInput event to replace the characters with a password character (like '*') while remembering "real" input read from the same event handler and keeping it in memory, invisible.

JnFred 4-Oct-11 5:19am
Thank you for your suggestion SAKryukov..
Ahn_7 4-Oct-11 5:22am
Thank you SAKryukov..I agree

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