We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Set the background colour of a RibbonComboBox

I've got a RibbonComboBox sitting on a RibbonBar on a RibbonTab on a Ribbon. From what I observe it is inheriting it's background colour through this chain. I would like to explicitly set it's background colour to White to make it stand out a bit better but setting the background property doesn't seem to work. I notice that I can set the background colour of a RibbonTextBox fine, but not the RibbonComboBox.

Is this directly settable?


Edit> Just to be clear, I want to set the background in it's non-dropped down state. Not e.g. the selection list



Here's a trivial example:-

<Window x:Class="TestComboBolour.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

        xmlns:sf="http://schemas.syncfusion.com/wpf"

        xmlns:local="clr-namespace:TestComboBolour"

        mc:Ignorable="d"

        Title="MainWindow" Height="450" Width="800">

    <sf:Ribbon>

        <sf:RibbonBar>

            <sf:RibbonComboBox Background="White" MinWidth="80">

                <sf:RibbonComboBoxItem>Test1</sf:RibbonComboBoxItem>

                <sf:RibbonComboBoxItem>Test2</sf:RibbonComboBoxItem>

                <sf:RibbonComboBoxItem>Test1=3</sf:RibbonComboBoxItem>

            </sf:RibbonComboBox>

        </sf:RibbonBar>

    </sf:Ribbon>

</Window>


1 Reply

HN Harinath Navaneethakrishnan Syncfusion Team January 12, 2023 03:01 PM UTC

Hi Declan,


We have checked on your query, we suggest you use SkinManager theme to solve this issue. We have prepared a sample which contains RibbonCombobox and Microsoft Combobox both having same behavior when applying Background and Foreground to the control. If you want to customize the Style of RibbonComboboxButton we suggest you to override the ControlTemplate.



Regards,

Harinath N



Attachment: RibbonCombobox_ec934988.zip

Loader.
Live Chat Icon For mobile
Up arrow icon