Wiki Home

Vfp Tricks


Namespace: VFP
Dynamic Grid Control Caption:

Form, Grid, Button in first column, 2 form methods:
PROCEDURE Init
   thisform.grd1.Column1.DynamicFontBold = [thisform.DynamicThings(this)]
ENDPROC

PROCEDURE DynamicThings
   Lparameters toGrid
   toGrid.Column1.Commandbutton1.caption = str( recno() )
   Return .f.
ENDPROC

Now you have numbered buttons. You can reference fields too. Or random words from War and Peace.

I return .f. so that bold is left off, but you are free to set bold to whatever you want.

I am surprised that the parameter is the grid, but it seems to be the grid.

Contributors: Carl Karsten
Category VFP Tips And Tricks
( Topic last updated: 2003.04.05 10:26:44 AM )