473,386 Members | 1,799 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.

font colour for disabled or read only textbox

Hello,
I have a textbox that needs to have red font.
I also want it set to enable=false, or else 'read-only'.
When I change to either of these settings, the font turns black.
Is there a way around this?
Thanks in advance,
Amber

Nov 22 '05 #1
3 10533
TextBox t = new TextBox();
t.ForeColor = Color.Red; // this is the line to change the text color

"amber" wrote:
Hello,
I have a textbox that needs to have red font.
I also want it set to enable=false, or else 'read-only'.
When I change to either of these settings, the font turns black.
Is there a way around this?
Thanks in advance,
Amber

Nov 22 '05 #2
One way is after making the text box read-only, manually change the
backcolor of the textbox to Color.FromKnownColor (KnownColor.Window):

//C#
textBox.BackColor = Color.FromKnownColor (KnownColor.Window);

"amber" <am***@discussions.microsoft.com> wrote in message
news:0C**********************************@microsof t.com...
Hello,
I have a textbox that needs to have red font.
I also want it set to enable=false, or else 'read-only'.
When I change to either of these settings, the font turns black.
Is there a way around this?
Thanks in advance,
Amber
Nov 22 '05 #3
this doesn't work if the cell is set to enabled = false
"Alex K" wrote:
TextBox t = new TextBox();
t.ForeColor = Color.Red; // this is the line to change the text color

"amber" wrote:
Hello,
I have a textbox that needs to have red font.
I also want it set to enable=false, or else 'read-only'.
When I change to either of these settings, the font turns black.
Is there a way around this?
Thanks in advance,
Amber

Nov 22 '05 #4

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

Similar topics

3
by: amber | last post by:
Hello, I have a textbox that needs to have red font. I also want it set to enable=false, or else 'read-only'. When I change to either of these settings, the font turns black. Is there a way...
7
by: Ed West | last post by:
Hello, I have a simple form with some input boxes. After validation if one fails, then I would like to at the top of the page say something like "The following fields in red are required" and...
60
by: deko | last post by:
As I understand it, most browser manufacturers have agreed on 16px for their default font size. So, this should be an accurate conversion for percentages: px % 16 = 100 14 = 87.5 13 =...
4
by: Bob | last post by:
Hi, Is it possible to change the forecolor of a disabled text control. I have a RichText Box that I don't want the user to edit but the Grey on Grey default is hard to read. Is there a way of...
1
by: spgedwards | last post by:
I am trying to run a basic script that displays an existing jpeg image and writes some text over it. Sounds simple, but I cannot seem to be able to colour the font correctly. In the example below...
4
by: H-S | last post by:
Please help. This is a real puzzler! Originally posted on microsoft.public.dotnet.framework.windowsforms but no answer found! I have a read-only textBox which shows the results of a selection...
7
by: garyusenet | last post by:
I'm using krypton toolkit which has allowed me to make a cool looking form. However, when I set my textbox to disabled it is 'greyed' out. The grey colour isn't in keeping with the office 2007...
2
by: =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?= | last post by:
HI there. I use IE7. We have a user with bad eyesight. he cannot read the font when IE makes an input disabled (the light grey color font). I am able to change the background to a different color...
6
by: Rob | last post by:
I would like to show dark fonts (so that the text is readable and not greyed out) in a text box, however, I do Not want the text box to be Enabled, because I do not want the text box to ever have...
3
by: helraizer1 | last post by:
Hi all, On one page of my site I have a form (code below) with an input textbox with the id "message". You type in your message in this field (as the id suggests) and depending on an option in a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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...

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.