Articles in this section
Category / Section

How to change the SelectedItem Background and MouseOver Background of CheckListBoxItems ?

1 min read

We can change the background colour of SelectedItem and MouseOver background colour by using SelectedItemBackground property and MouseOverBackground property respectively in our CheckListBox control.

 

The following example explains about the SelectedItemBackground and MouseOverBackground properties.

 

XAML

<syncfusion:CheckListBox x:Name="checkListBox" SelectedItemBackground="Red" MouseOverBackground="BlueViolet" >
           <syncfusion:CheckListBoxItem>WPF</syncfusion:CheckListBoxItem>
           <syncfusion:CheckListBoxItem>WindowsPhone</syncfusion:CheckListBoxItem>
           <syncfusion:CheckListBoxItem>WinRT</syncfusion:CheckListBoxItem>
           <syncfusion:CheckListBoxItem>WindowsForm</syncfusion:CheckListBoxItem>
           <syncfusion:CheckListBoxItem>SilverLight</syncfusion:CheckListBoxItem>
           <syncfusion:CheckListBoxItem>IOS</syncfusion:CheckListBoxItem>
</syncfusion:CheckListBox>

 

C#

checkListBox.SelectedItemBackground = new SolidColorBrush(Colors.Red);
checkListBox.MouseOverBackground = new SolidColorBrush(Colors.BlueViolet);

 

The output for the above code is shown below:

 

SelectedItemBackground = Red and MouseOverBackground = BlueViolet

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied