Change background color with color gradients

血红的双手。 提交于 2019-12-24 09:58:30

问题


I want to change the background color from my combobox. But I would like to retain the color gradients.

I've tried using this code but still does not get the effect.

<Setter Property="Background" Value="White"/> <!-- It's only white :( -->

回答1:


<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>

This will change the background color. Change the Color and Offset to get your desired result.



来源:https://stackoverflow.com/questions/11431159/change-background-color-with-color-gradients

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!