WPF BasedOn 自定义样式 例:ComboBox 组合框

自定义样式 ComboBox 组合框

<Window.Resources>
        <Style x:Key="ComboBox01" TargetType="ComboBox" BasedOn="{StaticResource ComboBoxBaseStyle}">
            <Setter Property="BorderBrush" Value="Green"></Setter>
            <Setter Property="hc:BorderElement.CornerRadius" Value="5"></Setter>
        </Style>
    </Window.Resources>

<Grid>
<ComboBox Width="300" Height="30" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="标题在左侧" Style="{StaticResource ComboBox01}" Text="正文1" Margin="210,192,225,209">
<ComboBoxItem>运动</ComboBoxItem>
<ComboBoxItem>唱歌</ComboBoxItem>
<ComboBoxItem>跳舞</ComboBoxItem>
</ComboBox>

</Grid>

 

posted @ 2022-05-26 15:13  seven&night  阅读(248)  评论(0编辑  收藏  举报