Change color selected item in CheckBoxList, C #

0

Is it possible to change the background color of the selected item in a CheckBoxList?

Something like this:

foreach (var item_select in checkBoxList1.CheckedItems)
{
   checkBoxList1.Items[item_select].BackColor = Color.SeaGreen;
}
  

But this: checkBoxList1.Items[item_select].BackColor = Color.SeaGreen; does not exist . And if I do so: checkBoxList1.BackColor = Color.SeaGreen; then I will shade the CheckBoxList complete.

Any ideas?

Environment: Visual Studio 2010 & .NET Netframework 4.

    
asked by J. Rodríguez 23.01.2018 в 20:52
source

1 answer

1

In windows forms it is not not only assigning the property to a color change you are looking for, you have to define the checkbox class to execute the drawn, which is the one that will allow the color change.

Of the site in English

    
answered by 23.01.2018 / 20:55
source