Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to highlight a row of text in a grid...
Message
De
16/02/2002 08:45:56
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00621076
Message ID:
00621099
Vues:
15
Hello Chris.

Hi - I have looked at Nick's excellent gridhighlighter class which works really well but being a curious sort of chap I want to create my own!

I have not seen the source code for Nick's Class, but there are several ways to solve this problem (at least until Toledo is released and this behavior will be native < s > )

Add a custom property to the grid class called nRecNo. This code in the the gid's Init():
*** Set up for highlighting current row
This.nRecNo = RECNO( This.RecordSource )
This.SetAll( 'DynamicForeColor', ;
	'IIF( RECNO( This.RecordSource ) = This.nRecNo, RGB( 0, 0, 128 ), RGB( 0, 0, 0 ) )', 'COLUMN' )
This.SetAll( 'DynamicBackColor', ;
	'IIF( RECNO( This.RecordSource ) = This.nRecNo, RGB( 0,255,255 ), RGB( 255, 255, 255 ) )', 'COLUMN' )
And this code in AfterRowColChange:
Thisform.LockScreen = .T.
WITH This
  .nRecNo = RECNO( .RecordSource )
  .Refresh()
ENDWITH
Thisform.Lockscreen = .F.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform