Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing JUST the font size of a label 2

Status
Not open for further replies.

DotNetter

Programmer
May 19, 2005
194
US
How do I simply change the size and boldness of a font of a label without changing the font-family?
Code:
lblClassName.Font = New System.Drawing.Font("Times New Roman", 14, System.Drawing.FontStyle.Bold)
...is more than I want - I don't want to change the font-family.

Thanks,
Dot
 
mmmmmmm

Code:
lblClassName.Font.size = 14

Code:
lblClassName.Font.sizeinpoints = 14


Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Christiaan,

Both of those properties are ReadOnly...

Thanks,
Dot
 
ERrr. .Net Differences....
DotNet is fully Object Oriented

label1.font = new font(......)
 
Whooppss.. sorry

Label1.Font = New Font(Label1.Font.FontFamily, 20)
 
Sorry.

apparantly this would be it

Code:
lblClassName.Font = new Font(lblClassName.Font.FontFamily,14,me.Font.Style,System.Drawing.FontStyle.Bold)


Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top