tags:

views:

294

answers:

3

Hello I am having a problem changing the text color of a textbox in vb I know that changing is like this

Textbox.ForeColor = Color.Red

when I do this it doesn't change anything still gives me the same black color . Also can it be because it in read only or is there some wrong with visual studio or My project

Edit: I am using VB 9 or VB 2008 w/ VS 2008 Express

+1  A: 

Unfortunately I don't think you can easily change the colours on a read-only textbox. There are some workarounds but they're a bit hacky.

Jon Skeet
shahkalpesh
Are you absolutely *sure* that it works with VB6? As I understood it, this is an issue with the Win32 textbox control. I haven't done any Win32 work for a long time though...
Jon Skeet
+1  A: 

It will work if you change the color and then reassign the text.

dim s as string
s = TextBox1.Text
TextBox1.ForeColor = Color.AliceBlue
TextBox1.Text = s
xpda
A: 

Go to propeties of text box find something called back color and you can change the color

vsdf