ForeColor Property  
 

Sets or returns the foreground color for the control.

Syntax

object.ForeColor [= color ]

Remarks

The ForeColor property returns the current foreground color for the control. Setting the property changes the color to the specified value.

Colors are RGB (Red Green Blue) values which range from 0 to 16,777,215 (&HFFFFFF). The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF). If the high byte isn't 0, the control uses the system colors, as defined in the user's Control Panel settings.

The following table lists the standard system color values and the Control panel settings that they correspond to:

Color Value Definition Control Panel Setting
80000000h Scrollbar background
80000001h Desktop Desktop
80000002h Active window caption Active Title Bar
80000003h Inactive window caption Inactive Title Bar
80000004h Menu background Menu
80000005h Window background Window
80000006h Window frame
80000007h Menu text Menu
80000008h Window text Window
80000009h Window caption text Active Title Bar
8000000Ah Active window border Active Window Border
8000000Bh Inactive window border Inactive Window Border
8000000Ch Background color Application Background
8000000Dh Items selected in a control Selected Items
8000000Eh Text of items selected in a control Selected Items
8000000Fh Face shading on push buttons
80000010h Edge shading on push buttons
80000011h Disabled text
80000012h Text on push buttons Caption Buttons
80000013h Text color for an inactive caption Inactive Title Bar
80000014h Highlight color for buttons
80000015h Dark color for 3D display elements
80000016h Light color for 3D display elements
80000017h Text color for ToolTip controls ToolTip
80000018h Background color for ToolTip controls ToolTip

Data Type

Integer (Int32)

See Also

BackColor Property, BoldColor Property, ColorMap Property