PROCEDURE grid1.AfterRowColChange LPARAMETERS nColIndex sele yourcursor this.activatecell(recno(),ncolindex) this.tooltiptext="current record selected= "+trans(recno()) ENDPROCyou can try the grid. gridhitTest method maybe can help you :
CLOSE DATABASES all Public oForm oForm = Createobject('myForm') oForm.Show Define Class myForm As Form DataSession = 1 Height = 400 Width=600 ShowTips = .T. Procedure Load close data all sele * from home(1)+"samples\data\customer" into cursor ycurs Endproc Add Object myGrd As Grid With RecordSource = 'ycurs',; left = 10,Top=10,Height=380,Width=580,anchor=15,; Highlight=.F.,HighlightRow=.F. Add Object myContainer As Container With ; left = 10,Top=10,Height=360,Width=580, BorderWidth=0,BackStyle=0 Add Object myLbl As Label With ; backcolor=Rgb(0,255,0),Visible=.F.,AutoSize = .T. Procedure myGrd.Init This.SetAll('enabled',.F.) This.SetAll('disabledforecolor',0) Endproc Procedure myContainer.MouseMove Lparameters nButton, nShift, nXCoord, nYCoord Local lcTip With Thisform.myGrd Store 0 To nWhere_Out , nRelRow_Out , nRelCol_Out , nView_Out If .GridHitTest(nXCoord, nYCoord, ; @nWhere_Out, @nRelRow_Out, @nRelCol_Out) And nWhere_Out = 3 .ActivateCell(m.nRelRow_Out, m.nRelCol_Out) try With .Columns(.ActiveColumn) lcTip = ; iif(Type(.ControlSource)='C', "Record:"+trans(recno())+" "+Eval(.ControlSource),; iif(Type(.ControlSource)='M', "Record:"+trans(recno())+" "+ Mline(Eval(.ControlSource),1)+'...','')) lcTip=lcTip+"-----"+ "Row="+TRANSFORM(nRelRow_out)+','+TRANSFORM(nRelCol_out)+"....activecolumn=" + TRANSFORM(thisform.myGrd.activecolumn)+CHR(13) Endwith catch endtry Endif Endwith With This.Parent.myLbl .Move(m.nXCoord+16,m.nYCoord+16) If !Empty(m.lcTip) .Caption = Trim(m.lcTip) .Visible = .T. If .Left + .Width > Thisform.Width .Move(Thisform.Width - .Width - 10,.Top) Endif Else .Visible = .F. Endif Endwith Endproc Enddefine