Changing ChecklistBox's CheckBox Background Color

一笑奈何 提交于 2019-12-25 16:09:25

问题


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

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