views:

39

answers:

1

I have to draw formatted text in such a manner that last line should always come with right align. for example.

"Some text ............................................................" Right align.

I can set font size etc in formatted can i set text like it always come in next line with right align.

A: 

If you are using a TextBlock within the control to display the text, then simply set the Width to the width of the parent control and the TextAlignment property.

Tim
In TextBlock whole text would go to left or right but as i mentioned i mentioned that i want only last always come at right regardless how my remaining text alignment
Firoz
Your last line would need to be in its own TextBlock, unfortunately. You can do this programmatically by deducing the last line, removing it from the initial TextBlock, and creating a new one and adding it to the end of the your control.
Tim