Solved

Bolding a textbox

Posted on 2009-05-06
7
281 Views
Last Modified: 2013-11-26
I need to bold a reading inside the I use the drawing.fontstyle.Bold but it triggers and error. What am I doing wrong?
readingLabel.ForeColor = readingLabel.BackColor

readingLabel.BackColor = System.Drawing.Color.Black

readingLabel.Font = system.drawing.FontStyle.Bold

Open in new window

0
Comment
Question by:cmdolcet
7 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 24313903
Try this way:

readingLabel.Font = New Font(readingLabel.Font, FontStyle.Bold)
0
 

Author Comment

by:cmdolcet
ID: 24314244
jp, I get an overload resolution fail because no NEW can be called without an narrowing conversion
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 24314283
How did you used ?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:cmdolcet
ID: 24314309
just like this:
readingLabel.Font = New Font(readingLabel.Font, FontStyle.Bold)
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 24314419
Just to be clear, is that particular line the one throwing the error?
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 125 total points
ID: 24314429
readingLabel is a textbox, right ?
Try to change it to:
readingLabel.Font = New System.Drawing.Font(readingLabel.Font, System.Drawing.FontStyle.Bold)
0
 
LVL 6

Expert Comment

by:MrJesse34
ID: 24315424
                   TextBox thisBox = new TextBox();
                    thisBox.Style.Add("Font-Bold", "True");
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now