Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Active Cell in a grid
Message
From
08/04/2001 07:50:19
 
 
To
08/04/2001 03:59:00
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00493331
Message ID:
00493336
Views:
13
Hi Alan.

>> When using a grid on a form, you can set the active colour of the cell, but as you move of the grid the colour change back to the inactive cell colour, is there any way of keeping the active colour on the last cell activated when not on the grid. <<

Add a property to your grid class called nRecNo and initialize it to 0.

This code in the grid'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' )
This in the grid's AfterRowColChange:
Thisform.LochScreen = .T.
WITH THIS
  .nRecoNo = RECNO( This.RecordSource )
  .Refresh()
ENDWITH
Thisform.LockScreen = .F.
Marcia
Previous
Reply
Map
View

Click here to load this message in the networking platform