473,466 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to change textbox font color when disable ?

When textbox properties enable = False the font in the textbox become gray
color. How do I change the gray color to black color ?
Regards,
Tee
Oct 8 '08 #1
10 17973
engteng wrote:
When textbox properties enable = False the font in the textbox become gray
color. How do I change the gray color to black color ?
If your users have had Windows PC's for more than about three days, then
you should not do this, unless you have a really, /really/ Good Reason
to do so (e.g. specialised applications for, say, poorly-lit working
conditions).

Grey text on disabled controls is /standard/ Windows behaviour that will
be exhibited when your application runs on practically every Windows PC
on the planet.

OK, there /are/ a few cases where this is justifiable; just so long as
(a) you realise that there are /very/ few such cases, and
(b) your users know in advance that your application is going to behave
this way.

Applications that do "odd" things may be reported as "buggy" or
un-installed completely (just try changing the screen resolution on me!)
:-)

Regards,
Phill W.
Oct 8 '08 #2
"engteng" <pa*****@gmail.com>'s wild thoughts were released
on Wed, 8 Oct 2008 18:23:47 +0800 bearing the following
fruit:
>When textbox properties enable = False the font in the textbox become gray
color. How do I change the gray color to black color ?
Normally when someone asks this it's because someone finds
the grey text hard to see. In which case they sould change
this colour on their PC to something other than grey.
--
Jan Hyde (VB MVP)

https://mvp.support.microsoft.com/profile/Jan.Hyde
Oct 8 '08 #3
On Oct 8, 6:23*am, "engteng" <pass...@gmail.comwrote:
When textbox properties enable = False the font in the textbox become gray
color. How do I change the gray color to black color ?

Regards,
Tee
Switch to WPF

:-)

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Oct 8 '08 #4
engteng:

I see what you are trying to do. Instead of setting the TextBox's Enabled
Property to False, try setting the ReadOnly Property to True.

I bet you a dollar this is what you are trying to accomplish.

"engteng" wrote:
When textbox properties enable = False the font in the textbox become gray
color. How do I change the gray color to black color ?
Regards,
Tee
Oct 8 '08 #5
This will do but what is the best way to avoid this textbox to have gotfocus
even it is readonly ?
Regards,
Tee

"jp2msft" <jp*****@discussions.microsoft.comwrote in message
news:3B**********************************@microsof t.com...
engteng:

I see what you are trying to do. Instead of setting the TextBox's Enabled
Property to False, try setting the ReadOnly Property to True.

I bet you a dollar this is what you are trying to accomplish.

"engteng" wrote:
>When textbox properties enable = False the font in the textbox become
gray
color. How do I change the gray color to black color ?
Regards,
Tee

Oct 9 '08 #6
You are right (Gray hard to see) so I am using Windows XP sp3 any way to
change the gray color ?

Regards,
Tee
"Jan Hyde (VB MVP)" <St***********@REMOVE.ME.uboot.comwrote in message
news:83********************************@4ax.com...
"engteng" <pa*****@gmail.com>'s wild thoughts were released
on Wed, 8 Oct 2008 18:23:47 +0800 bearing the following
fruit:
>>When textbox properties enable = False the font in the textbox become gray
color. How do I change the gray color to black color ?

Normally when someone asks this it's because someone finds
the grey text hard to see. In which case they sould change
this colour on their PC to something other than grey.
--
Jan Hyde (VB MVP)

https://mvp.support.microsoft.com/profile/Jan.Hyde

Oct 9 '08 #7
textbox.Next maybe

Cor

"engteng" <pa*****@gmail.comschreef in bericht
news:ej**************@TK2MSFTNGP02.phx.gbl...
This will do but what is the best way to avoid this textbox to have
gotfocus even it is readonly ?
Regards,
Tee

"jp2msft" <jp*****@discussions.microsoft.comwrote in message
news:3B**********************************@microsof t.com...
>engteng:

I see what you are trying to do. Instead of setting the TextBox's Enabled
Property to False, try setting the ReadOnly Property to True.

I bet you a dollar this is what you are trying to accomplish.

"engteng" wrote:
>>When textbox properties enable = False the font in the textbox become
gray
color. How do I change the gray color to black color ?
Regards,
Tee


Oct 9 '08 #8
On Oct 9, 11:38*am, "engteng" <pass...@gmail.comwrote:
This will do but what is the best way to avoid this textbox to have gotfocus
even it is readonly ?

Regards,
Tee

"jp2msft" <jp2m...@discussions.microsoft.comwrote in message

news:3B**********************************@microsof t.com...
engteng:
I see what you are trying to do. Instead of setting the TextBox's Enabled
Property to False, try setting the ReadOnly Property to True.
I bet you a dollar this is what you are trying to accomplish.
"engteng" wrote:
When textbox properties enable = False the font in the textbox become
gray
color. How do I change the gray color to black color ?
Regards,
Tee- Hide quoted text -

- Show quoted text -
It maybe considered as a primitive way, but you can try to handle your
ReadOnly Textbox's GotFocus event and when it gets focus then focus
another UI control to lose focus of textbox as follows:

'---------------------------------------------------
Private Sub TextBox1_GotFocus(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles TextBox1.GotFocus

' when it gets focus select another control
Textbox1.SelectNextControl

' ...OR focus another control manually
' eg: a button
Button1.Focus

End Sub
'-----------------------------------------------------

Hope this helps,

Onur Güzel
Oct 9 '08 #9
On Oct 9, 1:40*pm, kimiraikkonen <kimiraikkone...@gmail.comwrote:
On Oct 9, 11:38*am, "engteng" <pass...@gmail.comwrote:


This will do but what is the best way to avoid this textbox to have gotfocus
even it is readonly ?
Regards,
Tee
"jp2msft" <jp2m...@discussions.microsoft.comwrote in message
news:3B**********************************@microsof t.com...
engteng:
I see what you are trying to do. Instead of setting the TextBox's Enabled
Property to False, try setting the ReadOnly Property to True.
I bet you a dollar this is what you are trying to accomplish.
"engteng" wrote:
>When textbox properties enable = False the font in the textbox become
>gray
>color. How do I change the gray color to black color ?
>Regards,
>Tee- Hide quoted text -
- Show quoted text -

It maybe considered as a primitive way, but you can try to handle your
ReadOnly Textbox's GotFocus event and when it gets focus then focus
another UI control to lose focus of textbox as follows:

'---------------------------------------------------
Private Sub TextBox1_GotFocus(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles TextBox1.GotFocus

' when it gets focus select another control
Textbox1.SelectNextControl

' ...OR focus another control manually
' eg: a button
Button1.Focus

End Sub
'-----------------------------------------------------

Hope this helps,

Onur Güzel- Hide quoted text -

- Show quoted text -
Regarding to SelectNextControl in my previous post, as i forgot, don't
forget to pass required arguments mentioned on:
http://msdn.microsoft.com/en-us/libr...xtcontrol.aspx

...or selecting / focusing a specific control manually like button
would be shorter way to make your textbox lose focus when it gets
focus :-)

Thanks,

Onur Güzel
Oct 9 '08 #10
"engteng" <pa*****@gmail.com>'s wild thoughts were released
on Thu, 9 Oct 2008 16:48:30 +0800 bearing the following
fruit:
>You are right (Gray hard to see) so I am using Windows XP sp3 any way to
change the gray color ?
Sure, just change it under appearance settings.

Can't recall the steps to get you there in XP though.

J
>Regards,
Tee
"Jan Hyde (VB MVP)" <St***********@REMOVE.ME.uboot.comwrote in message
news:83********************************@4ax.com.. .
>"engteng" <pa*****@gmail.com>'s wild thoughts were released
on Wed, 8 Oct 2008 18:23:47 +0800 bearing the following
fruit:
>>>When textbox properties enable = False the font in the textbox become gray
color. How do I change the gray color to black color ?

Normally when someone asks this it's because someone finds
the grey text hard to see. In which case they sould change
this colour on their PC to something other than grey.
--
Jan Hyde (VB MVP)

https://mvp.support.microsoft.com/profile/Jan.Hyde
--
Jan Hyde (VB MVP)

https://mvp.support.microsoft.com/profile/Jan.Hyde
Oct 9 '08 #11

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

Similar topics

4
by: Craig Duffy | last post by:
When I load up my page, some of the text boxes show up with a light yellow color. I can't change it to any other color or even set it transparent. Anybody know what's going on? The background...
4
by: ACaunter | last post by:
Hi there, I was wondering if there was a way to change the font color of the text in the title bar... by default the title bar is that dark blue faiding into light blue and it has white text......
3
by: Wes McCaslin | last post by:
I have create a MDI form and a child form.I have a menu with a option to change the font color to red,blue, or yellow. but for some reason i can't figure this out. thanks wes
3
by: viral123 | last post by:
Hi all, does any one know how to get the functionality of get focus and lost focus using ASP.Net like VB.Net I want to change the textbox back ground color when it has the focus. I used...
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...
3
oll3i
by: oll3i | last post by:
how do I change input font color? thank You
0
by: jemitch0 | last post by:
I have a datagrid with a checkbox in the first column and two columns following containing text. When the checkbox is checked, I need to have the font color changed. I can get this to work fine using...
2
by: nspader | last post by:
Hello All, I have a DB that shows information generated on a form setup to look like a calendar. I am working with Windows 2000 and Access 2000. Public Sub PutInData() On Error GoTo...
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
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,...
1
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...
0
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...
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.