Link to home
Start Free TrialLog in
Avatar of cmdolcet
cmdolcetFlag for United States of America

asked on

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

Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Try this way:

readingLabel.Font = New Font(readingLabel.Font, FontStyle.Bold)
Avatar of cmdolcet

ASKER

jp, I get an overload resolution fail because no NEW can be called without an narrowing conversion
How did you used ?
just like this:
readingLabel.Font = New Font(readingLabel.Font, FontStyle.Bold)
Just to be clear, is that particular line the one throwing the error?
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MrJesse34
MrJesse34

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