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

Change enable=false forecolor

greeting folks

I would like to change the foreground color for a disabled textbox from the
dimmed gray to something else that is easlier readable. I can change the
background using the following:
textbox1.BackColor = System.Drawing.SystemColors.Control.White

however i cant for the life of me figure out the foreground . any help would
be appreciated

steve
Nov 21 '05 #1
4 5055
Q
Hey Stephen,

I had the same problem.
Since then, I use the ReadOnly-properth in stead of the Enabled.
If ReadOnly is set to true, the forecolor can be changed!
Maybe this helps you???

Regards,

Q

"Stephen" <St******@xjohnstontrading.com> wrote in message
news:e4****************@TK2MSFTNGP10.phx.gbl...
greeting folks

I would like to change the foreground color for a disabled textbox from the dimmed gray to something else that is easlier readable. I can change the
background using the following:
textbox1.BackColor = System.Drawing.SystemColors.Control.White

however i cant for the life of me figure out the foreground . any help would be appreciated

steve

Nov 21 '05 #2
excellent idea, i didnt think about that. i need to be able to change the
foreground to different colors depending on criteria in the app.... do u
have a example ?

again thanks
stephen
"Q" <Q@nomail.be> wrote in message
news:ew****************@tk2msftngp13.phx.gbl...
Hey Stephen,

I had the same problem.
Since then, I use the ReadOnly-properth in stead of the Enabled.
If ReadOnly is set to true, the forecolor can be changed!
Maybe this helps you???

Regards,

Q

"Stephen" <St******@xjohnstontrading.com> wrote in message
news:e4****************@TK2MSFTNGP10.phx.gbl...
greeting folks

I would like to change the foreground color for a disabled textbox from

the
dimmed gray to something else that is easlier readable. I can change the
background using the following:
textbox1.BackColor = System.Drawing.SystemColors.Control.White

however i cant for the life of me figure out the foreground . any help

would
be appreciated

steve


Nov 21 '05 #3
"Q" <Q@nomail.be> schrieb:
Since then, I use the ReadOnly-properth in stead of the Enabled.
If ReadOnly is set to true, the forecolor can be changed!


This doesn't work on my machine running .NET 1.1 SP1, Windows XP
Professional SP2. Using a richtextbox instead of the textbox will allow you
to set the forecolor even if the textbox is disabled or read-only.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4
Q
Hey again Stephen,

here's the example you asked for!

Regards,

Q

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MyTextbox.BackColor = System.Drawing.Color.Green
MyTextbox.ForeColor = System.Drawing.Color.White
End Sub

"Stephen" <St******@xjohnstontrading.com> wrote in message
news:eq****************@TK2MSFTNGP09.phx.gbl...
excellent idea, i didnt think about that. i need to be able to change the
foreground to different colors depending on criteria in the app.... do u
have a example ?

again thanks
stephen
"Q" <Q@nomail.be> wrote in message
news:ew****************@tk2msftngp13.phx.gbl...
Hey Stephen,

I had the same problem.
Since then, I use the ReadOnly-properth in stead of the Enabled.
If ReadOnly is set to true, the forecolor can be changed!
Maybe this helps you???

Regards,

Q

"Stephen" <St******@xjohnstontrading.com> wrote in message
news:e4****************@TK2MSFTNGP10.phx.gbl...
greeting folks

I would like to change the foreground color for a disabled textbox from
the
dimmed gray to something else that is easlier readable. I can change

the background using the following:
textbox1.BackColor = System.Drawing.SystemColors.Control.White

however i cant for the life of me figure out the foreground . any help

would
be appreciated

steve



Nov 21 '05 #5

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

Similar topics

1
by: Eric Robishaw | last post by:
I'm adding items to a CheckBoxList Control, and need the text in each checkbox list item to be a specific color. Here's what I'm trying: ListItem li = new ListItem(GroupName, GroupID);...
1
by: Jim | last post by:
Hey all, I'm trying to change the forecolor of asp.net textbox text as I mouse over them. I keep getting a javascript error that the item doesn't exist when trying to reference it by it's ID. Any...
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...
3
by: James | last post by:
Hello, I am having a problem with a MS Access 2000 Database that I partially helped create. I am recording visits that registered customers make to our store. I have a list of all the elidgible...
1
by: signzala | last post by:
i working on widndows application. I want to change forecolor of all cells in row for specific condition. can anybody help me how to do this ?
1
by: gurpreetintown | last post by:
How to change the fore color of a disabled combo box in runtime? platform - c#.net
4
by: TD | last post by:
I am trying to change the forecolor of a field in a subform that is in datasheet view. I am using Access 2007. I have tried everything I can think of to do this but the text still appears in...
2
by: Naushad | last post by:
Hi all, I am using the countinous form. I want to Enable/Disable the some fields for perticular records as per the following condition when open the form. I have written this code in "On Current...
1
by: Joel1334 | last post by:
Hi! How can I change forecolor of a selected value in combobox? when I select a value in a combobox and press a button to "activate" what I've selected I want the text to be green and then...
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:
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
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: 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
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,...

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.