Printer.Fonts Property
Gets all font names that are available for the current printer.
Namespace: Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
'Declaration
Public ReadOnly Property Fonts ( _
index As Integer _
) As String
public string this[
int index
] { get; }
public:
property String^ Fonts[int index] {
String^ get (int index);
}
member Fonts :
index:int -> string with get
JScript does not support indexed properties.
Parameters
index
Type: System.Int32The index of the font within the collection.
Property Value
Type: System.String
Returns a String.
Remarks
The Fonts property works together with the FontCount property, which returns the number of font names available for the Printer object. Fonts available in Visual Basic vary according to the computer configuration, display devices, and printing devices. Use both the Fonts and the FontCount properties to obtain information about printer fonts.
Note
The order of fonts returned by Fonts may be different than the order returned by Visual Basic 6.0.
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 retrieve the Fonts property values.
Dim Printer As New Printer
Dim i As Integer
For i = 0 To Printer.FontCount - 1
Printer.Print(Printer.Fonts(i))
Next
Printer.EndDoc()
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace
Other Resources
How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)
Deploying Applications That Reference the Printer Compatibility Library