【发布时间】:2010-10-21 10:41:43
【问题描述】:
我正在使用带有样式表的 WPF。在我的Style 中,我一直在尝试为CheckBox 定制虚线焦点边框的外观。我需要焦点边框只围绕正方形而不是整个控件绘制。
我将样式宽度设置为 15,虚线边框是正确的,但没有围绕正方形,它偏向一边。
我已经包含了样式。
感谢您的帮助。
样式表片段:
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle StrokeThickness="1" Stroke="Black" StrokeDashArray="1 2" SnapsToDevicePixels="true" Width="15"/>
</ControlTemplate>
</Setter.Value>
</Setter>
【问题讨论】:
标签: wpf focus styles resourcedictionary