在我的TextBlock样式中添加边框

时间:2015-09-09 09:50:47

标签: wpf

我有这种风格:

<Style x:Key="labelStyle" TargetType="TextBlock">
    <Setter Property="Foreground" Value="White" />
    <Setter Property="Background" Value="Gray" />
</Style>

我在我的图表style上使用此SmartLabel,我想添加边框。 有什么建议吗?

1 个答案:

答案 0 :(得分:0)

将Textblock包装在Border中:

<Border BorderThickness="1" BorderBrush="Black">
    <TextBlock ... />
</Border>

您也可以在边框上使用其他属性,例如BorderBrushThikness等等

相关问题