【发布时间】:2021-09-19 13:28:42
【问题描述】:
【问题讨论】:
【问题讨论】:
您可以设置BorderBrush="Purple"和BorderThickness="0,0,0,2"直接改变边框颜色和边框粗细。
如下:
<TextBox Width="150" Height="40" BorderBrush="Purple" BorderThickness="0,0,0,2">
<TextBox.Resources>
<!-- To also have the focused TextBox only have a border at the bottom,
we need to override this resource. -->
<Thickness x:Key="TextControlBorderThemeThicknessFocused">0,0,0,2</Thickness>
</TextBox.Resources>
</TextBox>
【讨论】:
0,0,0,1 呢?这样,您就不需要重新模板控件。
TextControlBorderThemeThicknessFocused 资源来更改它。我建议对提议的解决方案进行编辑,以将其包含在答案中。