【发布时间】:2012-07-10 23:35:19
【问题描述】:
我想从我的组合框中更改背景颜色。 但我想保留颜色渐变。
我已经尝试使用此代码,但仍然没有得到效果。
<Setter Property="Background" Value="White"/> <!-- It's only white :( -->
【问题讨论】:
标签: wpf colors background-color gradient
我想从我的组合框中更改背景颜色。 但我想保留颜色渐变。
我已经尝试使用此代码,但仍然没有得到效果。
<Setter Property="Background" Value="White"/> <!-- It's only white :( -->
【问题讨论】:
标签: wpf colors background-color gradient
<ComboBox>
<ComboBox.Background>
<LinearGradientBrush EndPoint="0,1">
<GradientStopCollection>
<GradientStop Color="Blue" Offset="0.5" />
<GradientStop Color="White" Offset="0.5" />
</GradientStopCollection>
</LinearGradientBrush>
</ComboBox.Background>
</ComboBox>
这将改变背景颜色。更改颜色和偏移以获得所需的结果。
【讨论】: