LPARAMETERS nButton, nShift, nXCoord, nYCoord if NOT (this.ToolTipText == this.OriginalToolTip) local nWhere_Out, nRelRow_Out, nRelCol_Out, nView_Out this.GridHitTest(m.nXCoord, m.nYCoord, ; @nWhere_Out) if NOT INLIST(m.nWhere_Out,13,14) this.ToolTipText = this.OriginalToolTip endif endifIn the Init of the Grid class:
this.OriginalToolTip = this.ToolTipTextThen define the Assign method for ToolTipText property of the grid with following code:
LPARAMETERS lcNewToolTip if NOT (this.ToolTipText == left(m.lcNewToolTip,254)) local lcStr, lnX, lnY declare integer GetCursorPos in Win32API as _GetCursorPos string @lcStr declare integer SetCursorPos in Win32API as _SetCursorPos integer x, integer y lcStr = replicate(chr(0), 8) = _GetCursorPos(@lcStr) lnX = ((( asc(substr(m.lcStr, 4, 1)) * 256) + asc(substr(m.lcStr, 3, 1))) * 256 + asc(substr(m.lcStr, 2, 1))) * 256 + asc(left(m.lcStr, 1)) lnY = ((( asc(substr(m.lcStr, 8, 1)) * 256) + asc(substr(m.lcStr, 7, 1))) * 256 + asc(substr(m.lcStr, 6, 1))) * 256 + asc(substr(m.lcStr, 5, 1)) = _SetCursorPos(0, 0) DOEVENTS this.ToolTipText = left(m.lcNewToolTip,254) = _SetCursorPos(m.lnX, m.lnY) endifAs you see, I found a way to force VFP to hide previous tool tip and display new tool tip when mouse is moving from one element of grid to another. Looks not bad. I suspect there could be a better way (send some Windows message to form or so), I did not experimented more once I found one solution that is good enough.