Microsoft KB Archive/159271

= HOWTO: Set the BackColor Property to Same Color as Title Bar =

Article ID: 159271

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q159271



SUMMARY
This article provides information on how to change the BackColor property of a shape object in Visual FoxPro to the same color as the form's active title bar.



MORE INFORMATION
The following example creates a form that contains a shape. Code in the Click event of the command button changes the BackColor property of the shape from its default color to the color of the form's title bar.

 Create a form Place a shape object on the form. The name of this shape should be Shape1.  Add a command button to the form and place the following code in the Click event of the button: DECLARE INTEGER GetSysColor in User32.dll Integer Thisform.Shape1.BackColor=GetSysColor(2) ThisForm.Refresh  Run the form and press the command button. The backcolor of the shape changes to the same color as the forms title bar.

The integer "2" in the GetSysColor function points to the value of COLOR_ACTIVECAPTION from the Winuser.h file. The GetSysColor function is case sensitive; therefore, code must be entered exactly as shown above. The Winuser.h file is not a Visual FoxPro file. For more information on this file, consult Windows SDK literature. Information on the GetSysColor function is available in the Win32 API Quick Reference help file that ships with Visual FoxPro 3.0 and 3.0b Professional versions.

Keywords: kbhowto KB159271

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.