I’m trying to center the text in a PassWord box:
In Blend the Text properties for alignment are all disabled.
Is there another way to do this?
Thank you for your help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
HorizontalContentAlignment works in WPF, doesn’t seem to work in Silverlight though unfortunately.
For Silverlight you need to tweak the template for the PasswordBox a little – you can extract the template for the password box (in Blend right click the PasswordBox, select ‘Edit Template -> Edit a Copy’) and then set the HorizontalAlignment on the ContentElement to {TemplateBinding HorizontalContentAlignment} – e.g.
Then it seems to have the same behaviour as the WPF version and you can set HorizontalContentAlignment on the PasswordBox element as required.