Common Environment Object M ...


Visual Studio
Foreground Property

Sets or returns the foreground color of the item.

[Visual Basic .NET]
Public Property Foreground() As OLE_COLOR
[Visual Basic 6]
Property Get Foreground() As OLE_COLOR
Property Let Foreground( _
   ByVal NewValue As OLE_COLOR _
) 
[C++]
HRESULT __stdcall get_Foreground(
   /* [out, retval] */ OLE_COLOR* retVal
);
HRESULT __stdcall put_Foreground(
   /* [in] */ OLE_COLOR NewValue
);
[C#]
public OLE_COLOR Foreground {get; set;}
[JScript .NET]
public function get Foreground() : OLE_COLOR
public function set Foreground(
   NewValue : OLE_COLOR
)

Parameters

NewValue
An OLE_COLOR object specifying the color of the item.

Return Value

Returns an OLE_COLOR object specifying the color of the item.

Example

The following example lists the foreground, background, and bold values for the first colorable item.

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

See Also

Applies To: ColorableItems Object | FontsAndColorsItems Collection

Page view tracker