Share via


Printer.Font Property

 

Gets or sets a FontFamily by name.

Namespace:   Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

public Font Font { get; set; }
public:
property Font^ Font {
    Font^ get();
    void set(Font^ value);
}
member Font : Font with get, set
Public Property Font As Font

Property Value

Type: System.Drawing.Font

Returns a Font.

Remarks

The Font property determines the font that will be used for the next print operation. The FontBold, FontItalic, FontSize, FontStrikethru, and FontUnderline properties determine the style of the font.

Note

Only TrueType fonts are supported.

Note

Functions and objects in the Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic. In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

Examples

The following example demonstrates how to set the Font property.

Dim pr As New Printer
Dim pFont As New Font("Arial", 14)
pr.Font = pFont
pr.Print("This text will print in 14 point & _
    CStr(pr.Font.FontFamily.Name))
pr.EndDoc()

See Also

Printer Class
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace

4e434922-3709-49c6-a69d-38120ed72d7abc1bcb98-e13b-4c68-a514-045c042dbf367f9351ea-cb3e-4615-8f70-5a29c165c1a7

Return to top