Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Of course we're all hoping for a more mature grid in VFP 8. Meanwhile, the MicroEndeavors method works well:
Add a numeric property to the form, initialized to 0.
In the Init of the grid, SetAll DynamicBackColor of the columns of the grid based on whether the form property equals the RECNO() of whatever RecordSource the grid is displaying.
ThisForm.rnMyRecordNumber=RECNO('cMyTable')
This.SetAll( "DynamicBackColor", ;
"IIF( ThisForm.rnMyRecordNumber=RECNO('cMyTable'), ;
RGB(0, 255, 255), ;
RGB(255, 255, 255) )", "Column" )
In the When of each Control in each Column, set the property to the RECNO().
ThisForm.rnMyRecordNumber=RECNO('cMyTable')
This has the desirable effect of preserving the row highlight when the grid or even the form loses focus.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement