Bolding a textbox

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

Question by:cmdolcet
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 48

Expert Comment

ID: 24313903
Try this way:

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

Author Comment

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

Expert Comment

ID: 24314283
How did you used ?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

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

Expert Comment

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

Accepted Solution

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)

Expert Comment

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

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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