Skip to main content

Forecolor Property

The button's text color.

Definition​

Property "OLE.Forecolor" as Record

Values​

This property has the following record structure:

PosNameTypeDescriptionDefault
<1>NormalColorThe text color of the button in its normal stateNone
<2>HotColorThe text color of the button used when the user hovers the mouse over itNone
<3>PushedColorThe text color of the button used when the user presses itNone
<4>DisabledColorThe text color of the button used when it is disabledNone
<5>FocusColorThe text color of the button used when is has focusNone

Remarks​

The Forecolor property establishes a custom color for your button's caption.

note

For any field set to "None", the text color in that state is determined by the Style property, which uses system colors or Office XP theme colors.

Example​

// Make the caption change colors depending on the button state.
Forecolor = ""
Forecolor<1> = "Red"     ; // Normal
Forecolor<2> = "Pink"    ; // Hot
Forecolor<3> = "Maroon"  ; // Pressed
Forecolor<4> = "Gray"    ; // Disabled
Forecolor<5> = "Blue"    ; // Focused (and at rest)
Set_Property(@Window:".OLE_BUTTON", "OLE.Forecolor", Forecolor)

See Also​

Background