Stupid question.
I have Label1.Text = "Hello World"
How do I change the Forecolor in code? I know how to set it using VS but I
want to change the Forecolor depening on certain scenerios.
Thanks!You would simply use the ForeColor property. If you want to set it depending
on different conditions, use an if statement like the following:
If Label1.Text <"" Then Label1.ForeColor = Color.Black
Hopefully this is enough to get you started on what you needed. Good Luck!
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:uqLAj$kTHHA.4028@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Newbie learning in VB.NET
>
Stupid question.
>
I have Label1.Text = "Hello World"
>
How do I change the Forecolor in code? I know how to set it using VS but
I want to change the Forecolor depening on certain scenerios.
>
Thanks!
>
That's perfect. Thanks!
"Nathan Sokalski" <njsokalski@.hotmail.comwrote in message
news:%2389npBnTHHA.192@.TK2MSFTNGP04.phx.gbl...
Quote:
Originally Posted by
You would simply use the ForeColor property. If you want to set it
depending on different conditions, use an if statement like the following:
>
If Label1.Text <"" Then Label1.ForeColor = Color.Black
>
Hopefully this is enough to get you started on what you needed. Good Luck!
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/
>
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:uqLAj$kTHHA.4028@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
>Newbie learning in VB.NET
>>
>Stupid question.
>>
>I have Label1.Text = "Hello World"
>>
>How do I change the Forecolor in code? I know how to set it using VS but
>I want to change the Forecolor depening on certain scenerios.
>>
>Thanks!
>>
>
>
0 comments:
Post a Comment