|
-
March 11th, 2009, 06:13 AM
#1
Changing text color in a text box?
Hi All
I am using Visual C# 2008 to design a small application.
I cannot seem to change the color of text within a textBox, the code I am using but will not work is:
textBoxName.ForeColor = Color.White;
Thanks in advance for your help.......
Cheers,
Paul......
-
March 11th, 2009, 06:28 AM
#2
Re: Changing text color in a text box?
This works perfectly for me. Have you changed any other properties in your textbox?
-
March 11th, 2009, 06:39 AM
#3
Re: Changing text color in a text box?
Yea- I have textBoxName.Enabled = False;
When I change this to True I can change the text color but I don't want the user to be able to edit the text within this text box thats why I originally set it to false.
Do you have any suggestions to overcome this?
-
March 11th, 2009, 06:45 AM
#4
Re: Changing text color in a text box?
Yes I have a suggestion. If your text box is going to be disabled then I would suggest using a label instead. This is the correct way of displaying read-only data.
-
March 11th, 2009, 06:51 AM
#5
Re: Changing text color in a text box?
Will do- Thanks for your help.........
-
March 11th, 2009, 06:57 AM
#6
Re: Changing text color in a text box?
 Originally Posted by Shuja Ali
Yes I have a suggestion. If your text box is going to be disabled then I would suggest using a label instead. This is the correct way of displaying read-only data.
What if you have a lot of text to show? Labels don't wrap the string to the next line...
-
March 11th, 2009, 07:21 AM
#7
Re: Changing text color in a text box?
 Originally Posted by Salbrismind
What if you have a lot of text to show? Labels don't wrap the string to the next line...
Set AutoSize property to false and see if the Label wraps the text to next line or not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|