How to Create Special Effects in a GridLast reviewed: October 18, 1996Article ID: Q126839 |
The information in this article applies to:
SUMMARYDevelopers often need to dynamically control attributes of a Grid. A common example of this is a ledger, where the odd rows are presented in one color and the even rows in another color. Visual FoxPro uses the properties that have the prefix 'Dynamic' to achieve this.
MORE INFORMATIONThe DynamicBackColor, DynamicForeColor, DynamicFontBold, DynamicFontItalic, DynamicFontStrikeThru, DynamicFontUnderline, DynamicFontName, and DynamicFontSize properties dynamically specify an attribute of a Column object within a grid. As their Dynamic prefix implies, these properties are reevaluated each time the Grid control is refreshed, and do not need to be reset manually. If the properties listed above apply to all of the columns across a row, the whole row will be affected. Use the SETALL method to modify one property of all of the columns of a row. On the other hand, part of a row will have a different display if the Dynamic property only applies to a limited number of columns. The two examples that follow illustrate the use of the DynamicBackColor property applied to all of the columns and the DynamicFontUnderline property applied to one column in the grid.
Staggered List ExampleThis example displays even rows in red, and odd rows in blue. It uses the DynamicBackColor property and the SETALL method to modify the colors of the columns.
Modifying a Specific Cell ExampleThis example illustrates how to modify the font of a specific cell using the DynamicFontUnderline property.
Note that the DynamicColor property takes a character value, whereas the DynamicFontUnderline property accepts a logical value.
|
Additional reference words: 5.00 3.00 VFoxWin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |