Field text in TextBlock

Is it possible to use the Text field in a TextBlock?

My textBlock management style is here:

<Style x:Key="InfosStyle" TargetType="{x:Type TextBlock}"> <Setter Property="FontSize" Value="13"/> <Setter Property="FontWeight" Value="Normal"/> <Setter Property="Height" Value="35"/> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="TextAlignment" Value="Justify"/> <!--<Setter Property="BorderThickness" Value="1"/>--> <!--<Setter Property="BorderBrush" Value="#BFE3FE"/>--> <Setter Property="Background" Value="#BFE3FE"/> <Setter Property="Margin" Value="2,4,0,1" /> </Style> 

The result is here:

alt text

For the exam, I would like to align or set margin to text in textBlock.

Now: | Chatuje to | _Chatuje

I need to have free space on the left side in a TextBlock.

Free Space TextOfTextBlock

Not

TextOfTextBlock

+6
alignment margin wpf textblock
source share
2 answers

You need to install Padding in your style. Something like that

 <Setter Property="Padding" Value="10,0,0,0" /> 
+18
source share

It sounds like you need to install Padding instead of Margin.

+2
source share

All Articles