次の方法で共有


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

'Declaration
Public Property Font As Font
public Font Font { get; set; }
public:
property Font^ Font {
    Font^ get ();
    void set (Font^ value);
}
member Font : Font with get, set
function get Font () : Font 
function set Font (value : 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()

.NET Framework Security

See Also

Reference

Printer Class

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

Other Resources

Printer Compatibility Library

How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)

Deploying Applications That Reference the Printer Compatibility Library