Hi,
This is the class definition I use for highlighting my grids and making them readonly. When you want to make a form appear in the click event of the grid and or cell (control) you will have to add this to the click event of the control.
The lockscreen property is used to make it possible only to use lockscreen when the user clicked on the grid and starts scrolling, otherwise lockscreen is not necessary.
The SET CURSOR OFF setting works, but shows the cursor just for an instance and then dissappears.
**************************************************
*-- Class: grd_base (d:\cbproject\libs\base_cntrl.vcx)
*-- ParentClass: grid
*-- BaseClass: grid
*-- Time Stamp: 11/24/00 09:51:11 PM
*
#INCLUDE "d:\cbproject\include\app.h"
*
DEFINE CLASS grd_base AS grid
FontName = "MS Sans Serif"
DeleteMark = .F.
GridLines = 2
Height = 200
ReadOnly = .T.
RecordMark = .F.
Width = 320
GridLineColor = RGB(192,192,192)
*-- Stores te current record number of the record source.
rec_no = 0
Name = "grd_base"
*-- Indicates if highlighting should be.
lnohighlight = .F.
*-- Stores a logical indicating if the lockscreen should be used when scrolling.
PROTECTED luselockscreen
PROCEDURE BeforeRowColChange
LPARAMETERS nColIndex
LOCAL llRetVal
IF THIS.lUseLockScreen
THISFORM.LockScreen = .T.
ENDIF
ENDPROC
PROCEDURE Valid
LOCAL llRetVal
llRetVal = DODEFAULT()
IF llRetVal
THIS.lUseLockScreen = .F.
THISFORM.LOCKSCREEN = .F.
SET CURSOR ON
ENDIF
RETURN llRetVal
ENDPROC
PROCEDURE When
LOCAL llRetVal
llRetVal = DODEFAULT()
IF llRetVal
THIS.lUseLockScreen = .T.
THISFORM.LOCKSCREEN = .F.
SET CURSOR OFF
ENDIF
RETURN llRetVal
ENDPROC
PROCEDURE Refresh
DODEFAULT()
THIS.rec_no = RECNO(THIS.RECORDSOURCE)
ENDPROC
PROCEDURE AfterRowColChange
LPARAMETERS nColIndex
LOCAL llRetVal
llRetVal = DODEFAULT(nColIndex)
IF llRetVal
THIS.rec_no = RECNO(THIS.RECORDSOURCE)
ENDIF
IF THIS.luseLockScreen
THISFORM.LOCKSCREEN = .F.
ENDIF
RETURN llRetVal
ENDPROC
PROCEDURE Init
LOCAL llRetVal, lnCounter
llRetVal = DODEFAULT()
IF llRetVal AND !(THIS.lNoHighLight)
THIS.SETALL("DynamicBackColor", "IIF(RECNO(THIS.RecordSource) = THIS.rec_no, 8388608, 16777215)", "Column"

THIS.SETALL("DynamicForeColor", "IIF(RECNO(THIS.RecordSource)= THIS.rec_no, 16777215, 0)", "Column"

IF THIS.COLUMNCOUNT > 0
FOR lnCounter = 1 TO THIS.COLUMNCOUNT
WITH THIS.COLUMNS[lnCounter]
.Text1.BACKCOLOR = 8388608
.Text1.FORECOLOR = 16777215
.Text1.DISABLEDFORECOLOR = 8421504
.Text1.DISABLEDBACKCOLOR = 16777215
ENDWITH
ENDFOR
ENDIF
ENDIF
RETURN llRetVal
ENDPROC
ENDDEFINE
*
*-- EndDefine: grd_base
************************************************** Weedz (The Grassman)
veld4663@exact.nl
'It never hurts to help...' - Eek the cat.