Solved

Bolding a textbox

Posted on 2009-05-06
7
284 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
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.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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