共用方式為


Printer.ForeColor 屬性

取得或設定列印文字及圖形的色彩。

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

語法

'宣告
Public Property ForeColor As Integer
public int ForeColor { get; set; }
public:
property int ForeColor {
    int get ();
    void set (int value);
}
member ForeColor : int with get, set
function get ForeColor () : int 
function set ForeColor (value : int)

屬性值

類型:Int32
傳回 Integer。

備註

ForeColor 屬性會決定 Print 方法的文字色彩。 對於圖形方法, ForeColor 屬性會決定圖案的框線色彩,反之, FillColor 屬性會決定圖案的色彩。

注意事項注意事項

您可以將任何 .NET Framework ColorSystemColors 的值為 ForeColor 值呼叫 ToArgb 函式:

Printer.ForeColor = System.Drawing.Color.Violet.ToArgb

下表列出 ForeColor 的屬性是有效的 ColorConstantsSystemColorConstants 值。

常數

.NET Framework 對等用法

vbBlack

&h00

Black

vbRed

&hFF

Red

vbGreen

&hFF00

Green

vbYellow

&hFFFF

Yellow

vbBlue

&hFF0000

Blue

vbMagenta

&hFF00FF

Magenta

vbCyan

&hFFFF00

Cyan

vbWhite

&hFFFFFF

White

vbScrollBars

&H80000000

ScrollBar

vbDesktop

&H80000001

Desktop

vbActiveTitleBar

&H80000002

ActiveCaption

vbInactiveTitleBar

&H80000003

InactiveCaption

vbMenuBar

&H80000004

Menu

vbWindowBackground

&H80000005

Window

vbWindowFrame

&H80000006

WindowFrame

vbMenuText

&H80000007

MenuText

vbWindowText

&H80000008

WindowText

vbTitleBarText

&H80000009

ActiveCaptionText

vbActiveBorder

&H8000000A

ActiveBorder

vbInactiveBorder

&H8000000B

InactiveBorder

vbApplicationWorkspace

&H8000000C

AppWorkSpace

vbHighlight

&H8000000D

Highlight

vbHighlightText

&H8000000E

HighlightText

vbButtonFace

&H8000000F

ButtonFace

vbButtonShadow

&H80000010

ControlDark

vbGrayText

&H80000011

GrayText

vbButtonText

&H80000012

ControlText

vbInactiveCaptionText

&H80000013

InactiveCaptionText

vb3DHighlight

&H80000014

ControlLightLight

vb3DDKShadow

&H80000015

ControlDarkDark

vb3DLight

&H80000016

ControlLight

vb3DFace

&H8000000F

ControlDark

vb3Dshadow

&H80000010

ControlDarkDark

vbInfoText

&H80000017

InfoText

vbInfoBackground

&H80000018

Info

注意事項注意事項

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

範例

下列範例示範如何設定 ForeColor 屬性。

Dim pr As New Printer
pr.ForeColor = vbRed
pr.Circle(2000, 2000, 1000)
pr.EndDoc()

.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