Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default change colour of disabled textbox text

Hiya,

I have created a userform. There are 2 option buttons at the top - if they
select one, it will automatically diable all the textboxes on the userform.
If they select the other, it enables all the textboxes.

The problem is that when the textboxes are disabled, the colour of the text
within them goes grey and makes it hard to read (I need the users to be able
to see the textbox contents very clearly, even when disabled).

Is there a way that I can stop the disabling of a textbox from greying all
the textbox contents? Ideally I would like the content to go red, but staying
with the black would be fine.

Thanks,

Basil
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default change colour of disabled textbox text

Basil,

I think this is the preferred alternative. I was just reading about this in
Professional Excel Development the other day, don't know if I've got it
exactly right, though. It locks the textbox so can't be changed. One
benefit is that the user can still cut and paste the text in the textbox to
another locaiton, if needed. I changed the backcolor to the same color as
the buttons, so it indicates that you can't change it.:

Private Sub CommandButton1_Click()
Me.TextBox1.Locked = True
Me.TextBox1.BackColor = vbButtonFace
Me.TextBox1.ForeColor = vbRed
End Sub

hth,

Doug

"Basil" wrote in message
...
Hiya,

I have created a userform. There are 2 option buttons at the top - if they
select one, it will automatically diable all the textboxes on the

userform.
If they select the other, it enables all the textboxes.

The problem is that when the textboxes are disabled, the colour of the

text
within them goes grey and makes it hard to read (I need the users to be

able
to see the textbox contents very clearly, even when disabled).

Is there a way that I can stop the disabling of a textbox from greying all
the textbox contents? Ideally I would like the content to go red, but

staying
with the black would be fine.

Thanks,

Basil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default change colour of disabled textbox text

Thanks mate - simple and sweet!!

"Doug Glancy" wrote:

Basil,

I think this is the preferred alternative. I was just reading about this in
Professional Excel Development the other day, don't know if I've got it
exactly right, though. It locks the textbox so can't be changed. One
benefit is that the user can still cut and paste the text in the textbox to
another locaiton, if needed. I changed the backcolor to the same color as
the buttons, so it indicates that you can't change it.:

Private Sub CommandButton1_Click()
Me.TextBox1.Locked = True
Me.TextBox1.BackColor = vbButtonFace
Me.TextBox1.ForeColor = vbRed
End Sub

hth,

Doug

"Basil" wrote in message
...
Hiya,

I have created a userform. There are 2 option buttons at the top - if they
select one, it will automatically diable all the textboxes on the

userform.
If they select the other, it enables all the textboxes.

The problem is that when the textboxes are disabled, the colour of the

text
within them goes grey and makes it hard to read (I need the users to be

able
to see the textbox contents very clearly, even when disabled).

Is there a way that I can stop the disabling of a textbox from greying all
the textbox contents? Ideally I would like the content to go red, but

staying
with the black would be fine.

Thanks,

Basil




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Text Colour CT (Oxford, UK) Excel Discussion (Misc queries) 2 April 12th 09 12:18 PM
Textbox font colour change? Tdp Excel Discussion (Misc queries) 6 January 24th 09 05:11 PM
Change colour of font in a textbox? capt Excel Discussion (Misc queries) 2 January 24th 08 04:51 PM
Change text in Textbox on Chart? Matt Williamson Charts and Charting in Excel 3 January 5th 08 04:34 AM
change text colour Jeff New Users to Excel 3 February 15th 06 05:53 AM


All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"