news (in red). Is there a way to do this for a single literal or label? Or do
we need to have two, one set to green and one to red and just set one to a
text string and the other to ""?
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.comDim GoodNews as Boolean
....
If GoodNews Then
MessageLabel.Font.Color = Color.Green
Else
MessageLabel.Font.Color = Color.Red
End If
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:5D81CB86-10F8-471F-A5E7-00E187DABF4B@.microsoft.com...
> We have a status message we display that can be good news (in green) or
> bad
> news (in red). Is there a way to do this for a single literal or label? Or
> do
> we need to have two, one set to green and one to red and just set one to a
> text string and the other to ""?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
If you do it using a Literal you can set the Text property to the complete
markup e.g.
If GoodNews Then
Literal1.Text = "<span class='greencolorCss'>this is the status
for good news </span>"
Else
Literal1.Text = "<span class='redcolorCss'>this is the status
for bad news </span>"
End If
If you do it using a Label you might write:
If GoodNews Then
Label1.CssClass = "greencolorCss"
Label1.Text = "This is the status for good news"
Else
Label1.CssClass = "redcolorCss"
Label1.Text = "This is the status for bad news"
End If
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"David Thielen" wrote:
> We have a status message we display that can be good news (in green) or bad
> news (in red). Is there a way to do this for a single literal or label? Or do
> we need to have two, one set to green and one to red and just set one to a
> text string and the other to ""?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
0 comments:
Post a Comment