更改ChecklistBox的复选框背景颜色 [英] Changing ChecklistBox's CheckBox Background Color

查看:1163
本文介绍了更改ChecklistBox的复选框背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在工作的checklistBox,其中,我填充checklistBox在运行时从数据库,现在同时填充我检查,一个条件,如果它的false,CheckListBox中的ListItem应该被禁用,否则应该启用,它的工作正常,但我想前进一步,想改变禁用的listItem的背景颜色。如何更改所选listItem的ListItem背景颜色。

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.

推荐答案

谢谢你们,
我得到了答案问题..

Thanks guys, I got the answer for my question..

在for循环中,此语句将更改checklistBox内的checkBox的颜色:

In the for loop, this statement will change the color of checkBox within checklistBox:

checkListBox1.Items[i].Attribites.Add("style","background-color:red");

这篇关于更改ChecklistBox的复选框背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆