Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change Text Colour | Excel Discussion (Misc queries) | |||
Textbox font colour change? | Excel Discussion (Misc queries) | |||
Change colour of font in a textbox? | Excel Discussion (Misc queries) | |||
Change text in Textbox on Chart? | Charts and Charting in Excel | |||
change text colour | New Users to Excel |