>>>local grdKeyPressBindEvent >>>grdKeyPressBindEvent = CreateObject('grdKeyPressBindEvent') >>>grdKeyPressBindEvent.Show(1) >>> >>>define class grdKeyPressBindEvent as Form >>> >>>add object grd as grid with; >>> top = 10; >>> , left = 10; >>> >>>procedure LOAD >>>create cursor Test(Test1 C(10), Test2 C(10)) >>>insert into test values ('Test11', 'Test12') >>>insert into test values ('Test21', 'Test22') >>>go 1 >>> >>>procedure init >>>BindEvent(this.grd, 'KeyPress', this, 'grdKeyPress') >>> >>>procedure grdKeyPress >>>lparameters nKeyCode, nShiftAltCtrl >>>wait window Textmerge([grd.KeyPress(<<m.nKeyCode>>, <<m.nShiftAltCtrl>>)]) nowait noclear timeout 5 && never shows up >>> >>>enddefine >>>>>>
#define DEF_ALLOWCELLSELECTION .F. WAIT CLEAR local grdKeyPressBindEvent grdKeyPressBindEvent = CreateObject('grdKeyPressBindEvent') SET EVENTLIST TO KeyPress SET EVENTTRACKING TO "EVENTS.LOG" SET EVENTTRACKING ON grdKeyPressBindEvent.Show(1) SET EVENTTRACKING OFF SET EVENTTRACKING TO SET EVENTLIST TO MODIFY FILE "EVENTS.LOG" define class grdKeyPressBindEvent as Form add object grd as grid with; top = 10; , left = 10, AllowCellSelection = DEF_ALLOWCELLSELECTION ; procedure LOAD create cursor Test(Test1 C(10), Test2 C(10)) insert into test values ('Test11', 'Test12') insert into test values ('Test21', 'Test22') go 1 procedure init BindEvent(this.grd, 'KeyPress', this, 'grdKeyPress') procedure grdKeyPress lparameters nKeyCode, nShiftAltCtrl wait window Textmerge([grd.KeyPress(<<m.nKeyCode>>, <<m.nShiftAltCtrl>>)]) nowait noclear timeout 5 && never shows up enddefine