Public oForm oForm = Createobject('myForm') oForm.Show Define Class myForm As Form DataSession = 2 Height = 400 Width=600 ShowTips = .T. Procedure Load Use employee Endproc Add Object myGrd As Grid With RecordSource = 'Employee',; left = 10,Top=10,Height=380,Width=580,; 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(255,255,225),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) With .Columns(.ActiveColumn) lcTip = ; iif(Type(.ControlSource)='C', Eval(.ControlSource),; iif(Type(.ControlSource)='M', Mline(Eval(.ControlSource),1)+'...','')) Endwith 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 EnddefineWith Tooltiptext anyway:
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) With .Columns(.ActiveColumn) this.tooltiptext = ; iif(Type(.ControlSource)='C', Eval(.ControlSource),; iif(Type(.ControlSource)='M', Mline(Eval(.ControlSource),1)+'...','')) Endwith Endif Endwith EndprocCetin