共用方式為


Printer.IsDefaultPrinter 屬性

傳回值,決定是否要將目前選取的印表機定義 [控制台] 中的預設印表機。

命名空間:  Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

'宣告
Public ReadOnly Property IsDefaultPrinter As Boolean
public bool IsDefaultPrinter { get; }
public:
property bool IsDefaultPrinter {
    bool get ();
}
member IsDefaultPrinter : bool with get
function get IsDefaultPrinter () : boolean

屬性值

類型:Boolean
傳回 Boolean。

備註

如果 IsDefaultPrinter 屬性是 true,選取的印表機在控制台中識別的預設印表機。

注意事項注意事項

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間中的函式和物件都是供這些工具使用,以便從 Visual Basic 6.0 升級至 Visual Basic。在大多數情況下,這些函式和物件會複製在 .NET Framework 的其他命名空間中可以找到的功能。只有當 Visual Basic 6.0 程式碼模型與 .NET Framework 實作有顯著差異時,才需要這些項目。

範例

下列範例示範如何擷取 IsDefaultPrinter 屬性值。

Dim Printer As New Printer
If Printer.IsDefaultPrinter = True Then
    MsgBox("The default printer is already selected.")
End If

.NET Framework 安全性

請參閱

參考

Printer 類別

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間

其他資源

Printer Compatibility Library

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

Deploying Applications That Reference the Printer Compatibility Library