473,416 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

How to change disable color for Checkbox???

How to change disable color of Checkbox??? I have a checkbox with
forecolor in red but when i disable by set Enable properties to false
forecolor is changed to gray color but i don't want it. how to make
disable color as the same before set enable = false
Anyone can help me?????

May 26 '06 #1
4 10366
To get around that issue, I just create an event handler that, whenever the
checkbox is clicked, sets its value back to what I wanted it to be. If it is
supposed to be checked, then every click event checks the box, etc.

If the checkbox in question is always disabled but you just don't want it
gray, they you can even inherit a new control from TextBox and build that
behavior into the checkbox.

Dale
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Ma**************@gmail.com" wrote:
How to change disable color of Checkbox??? I have a checkbox with
forecolor in red but when i disable by set Enable properties to false
forecolor is changed to gray color but i don't want it. how to make
disable color as the same before set enable = false
Anyone can help me?????

May 28 '06 #2
Dale,Thank you for your reply.

But i have some questions? Checkbox are inherited from ButtonBase and
why u suggest me to create new control from TextBox ? Not a ButtonBase?
and another question,Are you can give me some code snippets about
inherit new control from TextBox?

and i will give you more information for my purpose:
I want to use all behavior of checkbox but only thing, the
forecolor of checkbox ( Text color) when it's disable,i don't want make
it's checkbox text color different from enable and only checkbox
region that can be gray color when it's disable, not a Text.

Please Help me???
Thanks.

Dale เขียน:
To get around that issue, I just create an event handler that, whenever the
checkbox is clicked, sets its value back to what I wanted it to be. If it is
supposed to be checked, then every click event checks the box, etc.

If the checkbox in question is always disabled but you just don't want it
gray, they you can even inherit a new control from TextBox and build that
behavior into the checkbox.

Dale
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Ma**************@gmail.com" wrote:
How to change disable color of Checkbox??? I have a checkbox with
forecolor in red but when i disable by set Enable properties to false
forecolor is changed to gray color but i don't want it. how to make
disable color as the same before set enable = false


Anyone can help me?????


May 28 '06 #3
Whoops. I meant to create a new checkbox by extending CheckBox, not TextBox.

Dale
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Ma**************@gmail.com" wrote:
Dale,Thank you for your reply.

But i have some questions? Checkbox are inherited from ButtonBase and
why u suggest me to create new control from TextBox ? Not a ButtonBase?
and another question,Are you can give me some code snippets about
inherit new control from TextBox?

and i will give you more information for my purpose:
I want to use all behavior of checkbox but only thing, the
forecolor of checkbox ( Text color) when it's disable,i don't want make
it's checkbox text color different from enable and only checkbox
region that can be gray color when it's disable, not a Text.

Please Help me???
Thanks.

Dale เขียน:
To get around that issue, I just create an event handler that, whenever the
checkbox is clicked, sets its value back to what I wanted it to be. If it is
supposed to be checked, then every click event checks the box, etc.

If the checkbox in question is always disabled but you just don't want it
gray, they you can even inherit a new control from TextBox and build that
behavior into the checkbox.

Dale
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Ma**************@gmail.com" wrote:
How to change disable color of Checkbox??? I have a checkbox with
forecolor in red but when i disable by set Enable properties to false
forecolor is changed to gray color but i don't want it. how to make
disable color as the same before set enable = false
Anyone can help me?????


May 28 '06 #4
Thanks.

May 29 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: HolaGoogle | last post by:
Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have to field.One is a "yes/no" field and another one is "number" field. To display the yes/no field...
5
by: Bob Bedford | last post by:
I create checkboxes using datas from a database (with PHP). I store all values in an array, as I must pass this value like a Form value. Now, in some cases, when a checkbox is selected, I must...
2
by: Kekec | last post by:
I have several disabled asp:checkboxes in my table, but when i open this page in Netscape 7, Disabled property is ignored. Offcourse in IE is all perfect! Can someone help me with this one?
1
by: Chip | last post by:
I'm using Andy Smith's RowSelectorColumn control (great control) and I'm not sure if this question is generic to all datagrid controls or this particular one. Is there a way to disable one of...
3
by: Marc Castrechini | last post by:
I have a page that changes an <ASP:Checkbox value based on a user entered value in a textboxm using client side Javascript. After my submit is fired the value for the chkMyCB.checked does not get...
1
by: Steve Wonderful | last post by:
d define a disabled checkbox list and like to override the default grey color, what property of the control should I use? I tried forecolor, and others, but seemed not to work.
3
by: James Lennon | last post by:
Does anyone know how to disable a single check box in a Windows Forms TreeView control.
2
by: Kevin | last post by:
I've been looking all over and I can't seem to find what ought to be simple. I need to disable a drop down when a checkbox is checked, and enable it when same checkbox is unchecked. I've...
5
by: masterej | last post by:
Developers, Is there any way to disable all checkboxes on a form? I have a form with 160 checkboxes and I want to be able to disable all of them. Is there a way I can do something like this: ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.