Alex Rivera | Logout

WPF Multiline TextBlock CenterAlignment Issue

Asked 2011-01-07T10:35:05.263
60

I'm having an issue with multiline text blocks where it is not center aligning properly

The text is coming like

abcde\nabc

This comes out

  abcde
  abc

What I want is

  abcde
   abc

This seems a simple thing and I would have thought that the textblock would center align like that automatically but it does not seem to.

Edit
Report

1 Answer

21

TextBlock.TextAlignment should do what you're asking for.

answered 2011-01-07T10:44:51.747

Your Answer