您需要在 XAML 中为 ComboBox 创建自定义样式,其中外部容器是带圆角的边框。在这个特定示例中,它是一个默认样式,将在整个应用程序中全面应用。控件和 ContentPresenter 的内容仍然必须在 Border 内声明。
<Style TargetType="{x:Type ComboBox}">
...
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBox}">
<Border CornerRadius="5">
...
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
13348 次 |
最近记录: |