PRB: BackColor for Objects in a Grid Appears to Be Incorrect

Last reviewed: August 30, 1995
Article ID: Q135915
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SYMPTOMS

Under certain conditions, you may find that the BackColor of an object contained within a grid appears to be incorrect.

CAUSE

this occurs if the BackStyle property of the object is set to Transparent, and the BackColor of the grid differs from that of the form on which it resides. An object contained within a grid inherits the BackColor of the form when the object's BackStyle property is set to Transparent.

RESOLUTION

Set the BackColor of the Object to the same value used by the grid.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open or switch to Microsoft Visual FoxPro, and open any table into the active work area.

  2. Type CREATE FORM TEST in the Command window, and press ENTER.

  3. Using the Property Window of the form, set the BackColor of the form to 255,0,0 to make the form's background color red.

  4. Place a grid on the form. Using the Property Window, set the ColumnCount property of the grid to 2.

  5. Using the Property Window, set the BackStyle property of Text1 in Column1 of the grid to Transparent.

  6. Using the Property Window, set the Sparse property of Column 1 to false (.F.).

  7. Save and run the Form. Note that Column 1 of the grid is Red because it is inheriting the BackColor Property of the form rather than the grid as expected.


Additional reference words: 3.00 VFoxWin
KBCategory: kbprg kbprb
KBSubcategory: FxprgGeneral


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: August 30, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.