locked
[WP8.1]Placeholder text not centered RRS feed

  • Question

  • Hi,

    I have a TextBox with a placeholder text,

    As you can see, the ph text is not centered in the vertical axis, how do I make it centered like that?

    The text that is written manually is centered and correctly aligned.

    -Vincent


    Tuesday, May 26, 2015 8:54 AM

Answers

  • Hi Vincent,

    An easy way to control that placeholder text is to edit the XAML of textbox control template. Right click on your TextBox, edit template > edit a copy, find the ContentControl named as “PlaceholderTextContentPresenter”, and add VerticalContentAlignment property.

    In the meantime, I will help edit the title according to Guide to posting: subject line tags. Please correct it if any misunderstanding.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, May 28, 2015 6:27 AM

All replies

  • I don't have winphone compatibility on this pc so I'm not sure it'll work but you can try something pretty easy.

    <TextBox VerticalContentAlignment="Center"


    Hope that helps.

    Technet articles: WPF: Change Tracking; All my Technet Articles


    Tuesday, May 26, 2015 9:07 AM
  • Hm, does not seem to work.

    Is this possible trough styling perhaps?

    Tuesday, May 26, 2015 1:35 PM
  • Hi Vincent,

    An easy way to control that placeholder text is to edit the XAML of textbox control template. Right click on your TextBox, edit template > edit a copy, find the ContentControl named as “PlaceholderTextContentPresenter”, and add VerticalContentAlignment property.

    In the meantime, I will help edit the title according to Guide to posting: subject line tags. Please correct it if any misunderstanding.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, May 28, 2015 6:27 AM