【发布时间】:2017-05-17 09:30:31
【问题描述】:
我正在编辑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>
这就是DatePicker 在这种风格下的样子:
如果我将Border 添加到TextBox,它会出现在白色Border 周围:
如果有人知道如何删除这个额外的Border,将不胜感激!
【问题讨论】:
标签: wpf xaml datepicker textbox controltemplate