Share via


Printer.ColorMode Property

 

Gets or sets a value specifying whether the output will print in color or in monochrome on a device that supports color.

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

Syntax

public short ColorMode { get; set; }
public:
property short ColorMode {
    short get();
    void set(short value);
}
member ColorMode : int16 with get, set
Public Property ColorMode As Short

Property Value

Type: System.Int16

Returns a Short.

Remarks

When the PrintAction property is set to PrintToPrinter and the current printer does not support color, this property is ignored. When the PrintAction property is set to PrintToFile, files are saved in an 8-bit Grayscale PostScript format regardless of the ColorMode value.

If you set this property after you call the Print method, a run-time exception occurs.

The following table lists the PrinterObjectConstants values that are valid for the ColorMode property.

Constant

Value

Description

vbPRCMMonochrome

1

Print output in monochrome (usually shades of black and white).

vbPRCMColor

2

Print output in color.

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 checks to see whether the current printer supports color and sets the ColorMode property accordingly.

Dim pr As New Printer
Dim ps As New Printing.PrinterSettings
If ps.SupportsColor = True Then
    pr.ColorMode = vbPRCMColor
Else
    pr.ColorMode = vbPRCMMonochrome
End If

See Also

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

bc1bcb98-e13b-4c68-a514-045c042dbf367f9351ea-cb3e-4615-8f70-5a29c165c1a74e434922-3709-49c6-a69d-38120ed72d7a

Return to top