How to Change Color of Push Buttons in FoxPro for Windows

Last reviewed: April 29, 1996
Article ID: Q106702
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0
  • Microsoft FoxPro for Windows, versions 2.5x, 2.6x

SUMMARY

In Visual FoxPro, the color of the text on a button is controlled by the ForeColor property of a Command Button.

In FoxPro 2.x, the color of a "normal" push button containing only text cannot be changed in Microsoft FoxPro for Windows. However, you can place a bitmap picture containing just text on the face of a "picture" push button; the text and background of the bitmap can be any color.

MORE INFORMATION

NOTE: The following only applies to FoxPro 2.x for Windows.

The FoxPro for Windows Screen Builder allows the creation of three types of push buttons: Normal, Invisible, and Picture. A Normal type push button takes on the color scheme used by the push buttons in all Windows-based applications (as defined in the Windows Control Panel) because, according to the common user interface standard, Windows-based applications should "look and feel" the same regardless of the application.

To use a push button in FoxPro that is a color other than the Windows default, do the following:

  1. Use Paintbrush or some other graphics program to create a .BMP file containing the text that will appear on the button.

  2. In FoxPro, create a new screen.

  3. Click the Push Button tool in the toolbox.

  4. Select Picture as the button type.

  5. Select the .BMP file that you created in step 1, and then choose Open.

  6. Assign a variable to the push button, and then choose OK.

REFERENCE

FoxPro for Windows, "User's Guide," version 2.5, pages U11-23 to U11-51


Additional reference words: FoxWin VFoxWin 2.50 2.50a 2.50b 3.00
CommandButton
KBCategory: kbprg
KBSubcategory: FxtoolSbuilder


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.