AutoRelease

DynamicFontBold, DynamicFontItalic, DynamicFontName, DynamicFontSize, DynamicFontStrikeThru, DynamicFontUnderline, DynamicFontOutline, DynamicFontShadow

The first six of these properties let you control the font characteristics of individual cells in a column of a grid. Like the dynamic color properties, these are very cool. The last two properties don't do anything in VFP/Windows, but can be used in VFP/Mac.

Usage

colColumn.DynamicFontBold = cBoldExpression cBoldExpression = colColumn.DynamicFontBold   colColumn.DynamicFontItalic = cItalicExpression cItalicExpression = colColumn.DynamicFontItalic   colColumn.DynamicFontName = cNameExpression cNameExpression = colColumn.DynamicFontName   colColumn.DynamicFontSize = cSizeExpression cSizeExpression = colColumn.DynamicFontSize   colColumn.DynamicFontStrikeThru = cStrikeThruExpression cStrikeThruExpression = colColumn.DynamicFontStrikeThru   colColumn.DynamicFontUnderline = cUnderlineExpression cUnderlineExpression = colColumn.DynamicFontUnderline
Each of these properties accepts a character expression that evaluates to a legal value of the font property in question. That is, the expressions for DynamicFontBold, DynamicItalic, DynamicFontStrikeThru and DynamicFontUnderline should evaluate to logical values, while the expression for DynamicFontName should result in a character value (a font name) and for DynamicFontSize, the expression should yield numeric results.

The key, though, is that the value of the DynamicWhatever properties is the character expression itself. It shouldn't be evaluated until the form is actually executing.

Most of the time, the expressions involve IIF() and values in the table the grid is based on. Of course, you can use anything at all and can do really weird stuff if you choose. You're limited only by your imagination, which, judging by FoxPro programmers we know, is a really scary thing.

Example

* In the grid described under DynamicBackColor, imagine that we  * want to highlight expensive products. We'll set some columns  * to use italics for any product with a unit_price of * more than $50.   * For each column you want italicized, set it with this  * expression, assuming This represents the grid: This.DynamicFontItalic = "IIF(Product.Unit_Price>50,.T.,.F.)
DynamicFontOutline and DynamicFontShadow don't do anything in Visual FoxPro for Windows, since it doesn't support outline and shadow fonts (and that's because Windows doesn't support them). These two do work in Visual FoxPro for Mac.

See Also

AFont(), DynamicAlignment, DynamicBackColor, DynamicForeColor, DynamicInputMask, FontBold, FontItalic, FontName, FontOutline, FontShadow, FontSize, FontStrikeThru, FontUnderline


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net