>Build a Form with a Grid and a CommandButton.
>On the grid add dynamicXXXX expressions.
>On
>
>CommandButton.Click
> thisform.grid.Refresh
>
>Run:
>when you click,
>the Refresh cycle is done one time.
>when the Click event is released,
>
VFP fire another refresh cycle after the form.Paint event !>
>THIS HAVE THREE EFFECTS:
>
>1. BIG i cannot control the context where the Dynamics are evaluated !
>
>2. MEDIUM if i put into the Paint event my code for implement personal graphics behaviour,
>it is not the last GDI directives send to WINDOWS!
>
>3. MEDIUM a VFP complex grid interface is slow down a lot!
>
>
The tragicomic thing.>
>If you put a :
>
>CommandButton.Click
> thisform.grid.columnX.Refresh
>
>then:
>- when the columnX.Refresh line is executed, no dynamics are evaluated,
>but when the Click event is released ( and VFP execute the redraw of the form ),
>after the Paint event
the columnX Dynamics are evaluated !Dynamic properties are based on logical expressions -- expressions that you can control both for functionality and to some degree for speed. Rules I have tried to follow when constructing these logical expressions:
1) Place the most important ( I call them GO/NO GO ) decisions first in any compound expression. Since Foxpro's expression evaluator starts with the first clause and marches down the and / or logic, by putting the clauses in importance sequence -- often the entire expression does not have to be evaluated. For example, if the column is not visible, you may not want to check anything further.
2) Be extremely careful of UDF's in the logical expression, code these expressions with native VFP code. For example, no I/O should be done.
3) If the desire is appearance, with three or more dynamic properties for the same column ( colors, fonts, etc ), consider establishing two controls and just switch between them with the DynamicCurrentControl instead of setting multiple properties on a single control. For example two text boxes, one with bold=.F., forecolor=0, and italic=.f. and a second one with bold=.T., forecolor=255 and italic=.t.
4) Save results of formulae, and test the result, not re-run the formula for each dynamic logical expression.
5) If you have many dynamic properties consider embedding any grid refresh between LockScreen=.T. and LockScreen=.F.
Hope at least one of the helps...