共用方式為


ColorableItems.Foreground 屬性

設定或取得項目的前景色彩。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
Property Foreground As UInteger
    Get
    Set
uint Foreground { get; set; }
property unsigned int Foreground {
    unsigned int get ();
    void set (unsigned int value);
}
abstract Foreground : uint32 with get, set
function get Foreground () : uint
function set Foreground (value : uint)

屬性值

型別:System.UInt32
指定項目色彩的單位。

範例

Sub ForegroundExample()
   Dim props As EnvDTE.Properties
   props = DTE.Properties("FontsAndColors", "TextEditor")
   Dim prop As EnvDTE.Property = props.Item("FontsAndColorsItems")
   Dim clritems As EnvDTE.FontsAndColorsItems = prop.Object
   Dim clritem As EnvDTE.ColorableItems = clritems.Item(1)
   Dim ClrList As String

   ClrList += "Background color: " & clritem.Background.ToString & vbCr
   ClrList += "Foreground color: " & clritem.Foreground.ToString & vbCr
   ClrList += "Bold?: " & clritem.Bold.ToString
   MsgBox(ClrList)
End Sub

.NET Framework 安全性

請參閱

參考

ColorableItems 介面

EnvDTE 命名空間