?
Solved

Label Font Color

Posted on 2006-04-18
5
Medium Priority
?
838 Views
Last Modified: 2013-12-03
I want to set my label's font color. I tried the below code (and I tried other things that didn't work too).

lblMessage.font.color=red
0
Comment
Question by:net_susan
  • 2
  • 2
5 Comments
 
LVL 5

Assisted Solution

by:TheMehrdad
TheMehrdad earned 1600 total points
ID: 16479707
Hi, at runtime, use: lblMessage.ForeColor=Color.Red
Good luck
0
 
LVL 1

Author Comment

by:net_susan
ID: 16479917
Compiler Error Message: BC30451: Name 'Color' is not declared.
0
 
LVL 1

Author Comment

by:net_susan
ID: 16480033
Oh, I actually had a solution in a different question of mine.

      lblMessage.cssclass="someclass"


But, I'm still curious why I can't make it work the other way.
0
 
LVL 3

Assisted Solution

by:quanmac
quanmac earned 400 total points
ID: 16480300
You could do this:

lblStatus.ForeColor = "red";

That will make your font red.
0
 
LVL 5

Accepted Solution

by:
TheMehrdad earned 1600 total points
ID: 16480493
Hi,
I thought you have imported the System.Drawing,
You may use it in this way:
lblMessage.ForeColor=System.Drawing.Color.Red

Or you may add this line to the first line of the module:
Imports System.Drawing

And then write this code:
lblMessage.ForeColor=Color.Red

Good luck
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question