473,394 Members | 1,693 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,394 software developers and data experts.

Disable ForeColor

Hi,

Do we have a way to change the text color of a (textbox,
dropdownlist...) when they are at Enable = false.
Because i don't want to have light grey text when they are disabled.

I can use readonly on the textbox, but not with my dropdownlist.

Thank you !
Nov 18 '05 #1
3 3086
Nope, is the short answer. It's disabled. You aren't allowed to muck with
it.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Andre" <lo*****@cablevision.qc.ca> wrote in message
news:et*************@tk2msftngp13.phx.gbl...
Hi,

Do we have a way to change the text color of a (textbox,
dropdownlist...) when they are at Enable = false.
Because i don't want to have light grey text when they are disabled.

I can use readonly on the textbox, but not with my dropdownlist.

Thank you !

Nov 18 '05 #2

It's not possible in IE. For Mozilla and friends you can use:

input[disabled] {
color: #555555;
}

If you *have* to have this kind of thing in IE; then one solution is to create a custom TextBox
class that overrides the render method and generates something that looks like an <input> when the
control is !enabled, but isn't (for example, you could render <span style="border:solid 2px
black;color:#555555">Input Field Text</spa> -- you'd have to tweak the style to get it to your
liking).

Scott

"Andre" <lo*****@cablevision.qc.ca> wrote in message news:et*************@tk2msftngp13.phx.gbl...
Hi,

Do we have a way to change the text color of a (textbox,
dropdownlist...) when they are at Enable = false.
Because i don't want to have light grey text when they are disabled.

I can use readonly on the textbox, but not with my dropdownlist.

Thank you !

Nov 18 '05 #3

It's not possible in IE. For Mozilla and friends you can use:

input[disabled] {
color: #555555;
}

If you *have* to have this kind of thing in IE; then one solution is to create a custom TextBox
class that overrides the render method and generates something that looks like an <input> when the
control is !enabled, but isn't (for example, you could render <span style="border:solid 2px
black;color:#555555">Input Field Text</spa> -- you'd have to tweak the style to get it to your
liking).

Scott

"Andre" <lo*****@cablevision.qc.ca> wrote in message news:et*************@tk2msftngp13.phx.gbl...
Hi,

Do we have a way to change the text color of a (textbox,
dropdownlist...) when they are at Enable = false.
Because i don't want to have light grey text when they are disabled.

I can use readonly on the textbox, but not with my dropdownlist.

Thank you !

Nov 18 '05 #4

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

Similar topics

4
by: meska | last post by:
Hi all is there a way in a treeview to hide or disable node without reloading the tree or removing the node? I meen if i could programaticly set the node to be disabled ( grayed out, user cannot...
6
by: Mantorok | last post by:
Hi all Is it possible to disable a Control in .Net but have the text colour always in black? I would rather use Enabled property rather than Readonly as it does everything I need it to in one...
3
by: Steve Le Monnier | last post by:
When you make a textbox control disabled ( txtText1.Enabled = false; ) You're left with grey text on a greyer background, which is not ideal. The Read-Only property is no use to me as I need to...
2
by: tottigang | last post by:
Hi, I have a tabstrip and I have some tabs in it. On the first page, all the tabs are enabled, I need to disbale part of the tabs at a specific point in the application and again enable them. I...
2
by: Andre | last post by:
Hi, Do we have a way to change the text color of a (textbox, dropdownlist...) when they are at Enable = false. Because i don't want to have light grey text when they are disabled. I can use...
2
by: Agnes | last post by:
my client complaint that "when the textbox is disabled, the forecolor is too light ". How can I change it ? Thanks a lot
4
by: Matrixreloadedth | last post by:
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...
5
by: Ike | last post by:
Does anyone know how to disable a list box element in VB 6 ? Thanks Ike
17
by: govolsbaby | last post by:
Is there a way to leave the button forecolor unchanged when it is disabled? I have multiple buttons on the form and depending on various user inputs, some will or will not be enabled but I'd...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.