Textbox - Enabled False - Font Color 
Author Message
 Textbox - Enabled False - Font Color

Is there anyway to control the color of the font when the Enabled Property
of a Textbox is set to false?


Mon, 07 Jan 2002 03:00:00 GMT  
 Textbox - Enabled False - Font Color

Quote:
> Is there anyway to control the color of the font when the Enabled Property
> of a Textbox is set to false?

No.  To work round this, put your textbox on a borderless captionless frame.
When you want to disable the textbox, disable the frame instead and change
the textbox colours appropriately.

Bertie



Tue, 08 Jan 2002 03:00:00 GMT  
 Textbox - Enabled False - Font Color

Quote:

>Is there anyway to control the color of the font when the Enabled Property
>of a Textbox is set to false?

No, this color is set by individual users in their Display setup control
panel application. It is a bad user interface idea to tamper with these
settings and, in most cases, even to override them. You should always
respect the user's color choices in any general purpose application.

Why are you wanting this kind of effect and for what purpose? There may be
some alternatives that would work just as well.

Frank Carr



Tue, 08 Jan 2002 03:00:00 GMT  
 Textbox - Enabled False - Font Color
Thanks for your reply.  We don't necessarily want to override them.  It
sounds like the color combinations on the test machine are just less than
what we want.  I looked for the ability to configure the disabled color
choice and could not find it.  Can you point me to specifically what the
option is that controls this property.  We are using Windows NT 4.0.  What
we are ultimately trying to achive is:  Present a form with an array of
textboxes...some of which are "read-only"...some of which are "read-write".
If the text box is read-only we do not want the user to  be able to give it
the focus.  We have locked the text box...but this still allows for it to
receive the focus...even though it cannot be changed.  When tabbing through
the form we can correctly skip this text box through the use of the TabStop
property.  We are looking to get the same behavior when the user is not
mouse challenged.

Thanks.


Quote:

> >Is there anyway to control the color of the font when the Enabled
Property
> >of a Textbox is set to false?

> No, this color is set by individual users in their Display setup control
> panel application. It is a bad user interface idea to tamper with these
> settings and, in most cases, even to override them. You should always
> respect the user's color choices in any general purpose application.

> Why are you wanting this kind of effect and for what purpose? There may be
> some alternatives that would work just as well.

> Frank Carr




Tue, 08 Jan 2002 03:00:00 GMT  
 Textbox - Enabled False - Font Color

Quote:

>Thanks for your reply.  We don't necessarily want to override them.  It
>sounds like the color combinations on the test machine are just less than
>what we want.  I looked for the ability to configure the disabled color
>choice and could not find it.  Can you point me to specifically what the
>option is that controls this property.

Right click on the Desktop and select Properties from the menu or load the
Display applet from the Control Panel. Then click on the Appearance tab.
While this doesn't directly allow you to change the disabled color, you can
adjust it by changing the regular text colors. You can directly change this
value in the registry however. In Win95, it's under
HKEY_CURRENT_USER\Control Panel\Colors and is the GrayText value.

Quote:
>What we are ultimately trying to achive is:  Present a form with an array
of
>textboxes...some of which are "read-only"...some of which are "read-write".
>If the text box is read-only we do not want the user to  be able to give it
>the focus.  We have locked the text box...but this still allows for it to
>receive the focus...even though it cannot be changed.  When tabbing through
>the form we can correctly skip this text box through the use of the TabStop
>property.  We are looking to get the same behavior when the user is not
>mouse challenged.

In this case, simply use a label control rather than a text box since a
label is a text area that can't get focus or be edited by the user. If the
field can vary according to the state of the user/application, then place
both controls on the form in the same location and set the appropriate one
visible and hide the other when you load the form or when the state changes.

Frank Carr



Tue, 08 Jan 2002 03:00:00 GMT  
 Textbox - Enabled False - Font Color
Why are you not using labels for the read-only textboxes?  Labels
can't receive focus.  Adjusting the BackColor and BorderStyle, you
can make them look exactly like standard textboxes.

LFS

Quote:

> Thanks for your reply.  We don't necessarily want to override them.  It
> sounds like the color combinations on the test machine are just less than
> what we want.  I looked for the ability to configure the disabled color
> choice and could not find it.  Can you point me to specifically what the
> option is that controls this property.  We are using Windows NT 4.0.  What
> we are ultimately trying to achive is:  Present a form with an array of
> textboxes...some of which are "read-only"...some of which are "read-write".
> If the text box is read-only we do not want the user to  be able to give it
> the focus.  We have locked the text box...but this still allows for it to
> receive the focus...even though it cannot be changed.  When tabbing through
> the form we can correctly skip this text box through the use of the TabStop
> property.  We are looking to get the same behavior when the user is not
> mouse challenged.

> Thanks.



Tue, 08 Jan 2002 03:00:00 GMT  
 Textbox - Enabled False - Font Color
The scenario is a collection of textboxes, some of which can be r/w and some
of which can be r/o.  Those that are r/w v. r/o can vary on any given
execution of the application.  We had considered have two collections of
controls, one a textbox and one a label.  We were just hoping we could do it
without the second collection of controls and the associated bookkeeping.
The responses to my question have confirmed what I was guessing might be
true.


Quote:
> Why are you not using labels for the read-only textboxes?  Labels
> can't receive focus.  Adjusting the BackColor and BorderStyle, you
> can make them look exactly like standard textboxes.

> LFS



Tue, 08 Jan 2002 03:00:00 GMT  
 Textbox - Enabled False - Font Color

Quote:

>The scenario is a collection of textboxes, some of which can be r/w and
some
>of which can be r/o.  Those that are r/w v. r/o can vary on any given
>execution of the application.  We had considered have two collections of
>controls, one a textbox and one a label.  We were just hoping we could do
it
>without the second collection of controls and the associated bookkeeping.
>The responses to my question have confirmed what I was guessing might be
>true.

Why not create a user control that does this for you. It would be fairly
easy to implement something that had a textbox and a label as constituent
controls and you would simply mirror the functionality of the controls
through the user control's events/methods/properties.

Frank Carr



Wed, 09 Jan 2002 03:00:00 GMT  
 Textbox - Enabled False - Font Color

Quote:

> Is there anyway to control the color of the font when the Enabled Property
> of a Textbox is set to false?

How about making it readonly without using the Enabled property?
I Haven't Tried This(tm), but here's some old VB code I've had tucked
away:

Declare Function SendMessageBynum& Lib "User" Alias "SendMessage (ByVal
hWnd%, ByVal wMsg%, ByVal wParam%, ByVal lParam&)

  Dim Message_Return As Long
  Const Read_Only = &H400 + 31

  Message_Return = SendMessageBynum (MyText_Box.hWnd, Read_Only, 1, 0&)

If you want to disable the read-only, replace the 1 above with 0 and
issue the call again.



Sun, 13 Jan 2002 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Modify default font for me.combobox.enable = false

2. enabled = false cmdbtn label color

3. Enabled = false color HELP!!!

4. text color when enabled = false

5. Change mouse icon when textbox enabled = false

6. Help-- question re textbox enabled=false

7. Enable=False without dimming text in textbox

8. Change font and font color inside a textbox

9. textbox-colors enabled off

10. Multi Fonts, Multi Colors TextBox Control!

11. font color in disabled textbox control

12. Font Color of disabled textbox

 

 
Powered by phpBB® Forum Software