Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to highlight a row of text in a grid...
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00621076
Message ID:
00621099
Views:
10
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform