By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,780 Members | 1,550 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,780 IT Pros & Developers. It's quick & easy.

How to change textbox font color when disable ?

P: n/a
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
Share this Question
Share on Google+
10 Replies


P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.