我正在编辑DatePicker
的控件模板,但是TextBox
的样式有问题。文本周围有一个白色边框,这不是实际的TextBox
边框。
根据我的当前样式,我将TextBox
放在一个Border
里面,将TextBox
的Background
设置为透明,并将BorderThickness
设置为0。
<Border Grid.Column="0"
Height="25"
Background="DarkKhaki"
CornerRadius="5"
Grid.ColumnSpan="1">
<DatePickerTextBox x:Name="PART_TextBox"
Background="Transparent"
Grid.Column="0"
BorderThickness="0"
Focusable="{TemplateBinding Focusable}"
HorizontalContentAlignment="Stretch"
Grid.Row="0"
Grid.ColumnSpan="1"
Margin="1.143,0,1.056,0"/>
</Border>
这是使用此样式的
日期选择器
的外观:
如果我给文本框
添加一个Border
,它会出现在白色边框
周围:
如果有人知道如何去掉这个额外的边框
,将不胜感激!