问题
i am working on checklistBox, wherein, i am filling the checklistBox at runtime from database, now while filling i check, for a condition, if its false than, that ListItem in CheckListBox should be disabled, else it should be enabled, its working properly, but i want to go one step ahead and want to change the background color of the disabled listItem. how to change the ListItem background color of the selected listItem.
回答1:
Thanks guys, I got the answer for my question..
In the for loop, this statement will change the color of checkBox within checklistBox:
checkListBox1.Items[i].Attribites.Add("style","background-color:red");
来源:https://stackoverflow.com/questions/5277809/changing-checklistboxs-checkbox-background-color