473,832 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10435
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
9749
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 in my asp form i use a checkbox and fot he other field i use a normal text box. if the yes/no field is checked then the other field is enabled otherwise it has to be disabled.Here's what i've done so far: Do While Not ObjRS.EOF <td><input...
5
5990
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 disactivate other checkboxes. How can I do this ? here is the code:
2
1378
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
1597
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 the checkboxes based on data in the grid? If so, can you provide the syntax? Thanks, Chip
3
4493
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 the latest value of the checkbox. Does this sound like a posibility and if so how can I force the server to get the new value from the page? TIA,
1
6434
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
18207
by: James Lennon | last post by:
Does anyone know how to disable a single check box in a Windows Forms TreeView control.
2
26381
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 found any number of scripts to disable / enable a drop down but they are all made to work with 2 different buttons, radio group selections, etc. I can't seem to come up with one that can toggle off a single checkbox.
5
11283
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: for (int i = 0; i < 160; i++) { string checkbox = "checkBox" + i.toString(); (Cast)checkbox.enabled = false;
0
9795
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10499
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9320
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3078
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.