changing italics of a font

mikerob283

Member
Joined
Feb 15, 2005
Messages
12
Programming Experience
Beginner
lblStatus.Font.Italics = False


error - property 'italics' is 'readonly'

i laugh at myself, i knew it couldn't be that simple.
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
To change the font, use one of the overloaded constructors of the Font class to create a new font. Here's an example:
VB.NET:
lblStatus.Font = New Font(lblStatus.Font, FontStyle.Italic)
'use Or to combine two or more FontStyles:
lblStatus.Font = New Font(lblStatus.Font, FontStyle.Italic Or FontStyle.Bold)
 
Top Bottom