Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using RBG() Function in a Grid.
Message
De
02/06/2003 13:19:51
 
 
À
02/06/2003 12:12:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00795282
Message ID:
00795316
Vues:
21
Hi Winfred.

How can I use the RBG() Function in a Grid? Each time my recno() changes I want the color assigned to the RBG() Function to setfocus() only on the active record number it is on.

Add a property to the grid called nRecNo and initialize it to 0

This code in the grid's Init()
LOCAL lcBgColor, lcFgColor, lcExp
*** Set up for highlighting current row
DECLARE INTEGER GetSysColor IN "user32" INTEGER nIndex
lcBgColor = TRANSFORM( GetSysColor( 13 ) )
lcFgColor = TRANSFORM( GetSysColor( 14 ) )
lcExp = 'IIF( RECNO( This.RecordSource ) = This.nRecNo, ' + lcFgColor + ', ' + TRANSFORM( This.ForeColor ) + ' )'
This.SetAll( 'DynamicForeColor', lcExp, 'COLUMN' )
lcExp = 'IIF( RECNO( This.RecordSource ) = This.nRecNo, ' + lcBgColor + ', ' + TRANSFORM( This.BackColor ) + ' )'
This.SetAll( 'DynamicBackColor', lcExp, 'COLUMN' )
This code in the grid's AfterRowColChange():
Thisform.LockScreen = .T.
This.nRecNo = RECNO( This.RecordSource )
Thisform.Refresh()
Thisform.LockScreen = .F.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform