margin text in TextBlock
Is it possible margin Text in TextBlock control ?
My style on textBlock control 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>
开发者_开发知识库
Result is here:
For examole I would like align or set margin on text in textBlock.
Now: |Chatuje to |_Chatuje
I would like have some free space on left side in TextBlock.
Free space TextOfTextBlock
No
TextOfTextBlock
You need to set Padding in your style. Something like this
<Setter Property="Padding" Value="10,0,0,0" />
Looks like you need to set Padding instead of Margin.
精彩评论