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 Color 或 SystemColors 的值為 ForeColor 值呼叫 ToArgb 函式: Printer.ForeColor = System.Drawing.Color.Violet.ToArgb |
下表列出 ForeColor 的屬性是有效的 ColorConstants 和 SystemColorConstants 值。
常數 |
值 |
.NET Framework 對等用法 |
---|---|---|
vbBlack |
&h00 |
|
vbRed |
&hFF |
|
vbGreen |
&hFF00 |
|
vbYellow |
&hFFFF |
|
vbBlue |
&hFF0000 |
|
vbMagenta |
&hFF00FF |
|
vbCyan |
&hFFFF00 |
|
vbWhite |
&hFFFFFF |
|
vbScrollBars |
&H80000000 |
|
vbDesktop |
&H80000001 |
|
vbActiveTitleBar |
&H80000002 |
|
vbInactiveTitleBar |
&H80000003 |
|
vbMenuBar |
&H80000004 |
|
vbWindowBackground |
&H80000005 |
|
vbWindowFrame |
&H80000006 |
|
vbMenuText |
&H80000007 |
|
vbWindowText |
&H80000008 |
|
vbTitleBarText |
&H80000009 |
|
vbActiveBorder |
&H8000000A |
|
vbInactiveBorder |
&H8000000B |
|
vbApplicationWorkspace |
&H8000000C |
|
vbHighlight |
&H8000000D |
|
vbHighlightText |
&H8000000E |
|
vbButtonFace |
&H8000000F |
|
vbButtonShadow |
&H80000010 |
|
vbGrayText |
&H80000011 |
|
vbButtonText |
&H80000012 |
|
vbInactiveCaptionText |
&H80000013 |
|
vb3DHighlight |
&H80000014 |
|
vb3DDKShadow |
&H80000015 |
|
vb3DLight |
&H80000016 |
|
vb3DFace |
&H8000000F |
|
vb3Dshadow |
&H80000010 |
|
vbInfoText |
&H80000017 |
|
vbInfoBackground |
&H80000018 |
![]() |
---|
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 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間
其他資源
How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)
Deploying Applications That Reference the Printer Compatibility Library