System.Drawing.Font

All controls that display text expose a Font property to which you can assign a System.Drawing.Font object.
You can assign individual font properties at design time after expanding the Font node in the properties window
All controls point to their parent forms font unless you set a different font for the control.
This means that if you change the forms font either at design time or run time all the controls will inherit the new font except the ones you have set a custom font for.



Font Properties

Name -
Size -
Unit - indicates the unit orf measure for the size property and can be one of the following GraphicsUnit enumerated values: Point, Pixel, Inch, Millimeter, Display, Document and World.
Bold -
GdiCharSet -
GdiVerticalFont -
Italic
Strikeout -
Underline -
You cannot modify a Font attribute after you create a new Font
These properties can only be assigned in the constructor method which is overloaded to provide 13 different sytac forms that let you specify any possible combination of attributes.


Dim objFont As System.Drawing.Font 
objFont = New System.Drawing.Font("Arial", 12, System.Drawing.Font.FontStyle.Bold or System.Drawing.Font.FontStyle.Bold



Font Families

A font family is a group of fonts with the same typeface and different styles.
For example the Tahoma font family exists of the following:
Tahoma Regular
Tahoma Italic
Tahoma Bold Italic



© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext