Bolding a textbox

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

cmdolcetAsked:
Who is Participating?
 
Jorge PaulinoConnect With a Mentor IT Pro/DeveloperCommented:
readingLabel is a textbox, right ?
Try to change it to:
readingLabel.Font = New System.Drawing.Font(readingLabel.Font, System.Drawing.FontStyle.Bold)
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Try this way:

readingLabel.Font = New Font(readingLabel.Font, FontStyle.Bold)
0
 
cmdolcetAuthor Commented:
jp, I get an overload resolution fail because no NEW can be called without an narrowing conversion
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
Jorge PaulinoIT Pro/DeveloperCommented:
How did you used ?
0
 
cmdolcetAuthor Commented:
just like this:
readingLabel.Font = New Font(readingLabel.Font, FontStyle.Bold)
0
 
käµfm³d 👽Commented:
Just to be clear, is that particular line the one throwing the error?
0
 
MrJesse34Commented:
                   TextBox thisBox = new TextBox();
                    thisBox.Style.Add("Font-Bold", "True");
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.