I just populate TextBlock with some text which has ! (exclamation mark) at the end. And ! appears in front of the text.
So instead of
some text!
I see
!some
text
How is it possible?
Any clue?
Thank you!
CODE
TextBlock tb = new TextBlock();
tb.Text = Text;
lstItems.Children.Add(tb); // lstItems is a StackPanel
Most likely, an ancestor of the
TextBlockhas itsFlowDirectionset toRightToLeft. Try resetting it toLeftToRight:Edit: The reason is a bit complex to explain; it has to do with how bi-directional text is rendered. From Wikipedia:
WPF is treating your
!as separate from the rest of the text, and placing it such that it follows your direction’s flow (in this case, to therightleft).