Naomi --
Actually, you've identified the one failure in this technique. It only works if the focus is on the grid. If not, then it tries to use ActivateCell. I agree, not the best user interface.
However, I have found it vary valuable. I use this technique throughout my applications. I regularly have pop-ups aligned with cells in a grid, frequently with displays obtained from reading from other tables. In fact, my users expect (sometimes demand) it, as this allows for display of detail behind a cell without moving to a separate form.
BTW, this entire concept was not my idea -- it came from a FoxTalk article some time ago and was called something like "DynToolTip". So, it came from a better mind than mine.
>Hi Jim,
>
>Your test is temporarily activating the row the user is on which is not really good in terms of user interface.
>
>There is really genious idea of using DynamicFontShadow property for this. I had the tooltip implemented using the code from Russian web site. I once sent Fred Taylor my version of it (basically at that point I only translated the comments). Later I tried to modify this a bit, but unfortunately I don't have the code anymore.
>
>I may do some searches for this if required.
>
>>John --
>>
>>I have the following for each column in my grid.
>>
>>I hope this works; I've thrown a lot of code that's clearly irrelevant and distracting -- hopefully that's all I threw away.
>>
>>Procedure MouseMove(x1,x2,x3,x4)
>> Local nXCoord_In, nYCoord_In, lnColno, lnDiff, loGrid, nWhere_Out, nRelRow_Out, nRelCol_Out
>> Local nView_Out
>>
>> With This.Parent
>>
>> * find out what row we're over
>> nXCoord_In = Mcol(Wontop(),3)
>> nYCoord_In = Mrow(Wontop(),3)
>> Store 0 To nWhere_Out , nRelRow_Out , nRelCol_Out , nView_Out
>> .GridHitTest(nXCoord_In, nYCoord_In, @nWhere_Out, @nRelRow_Out, @nRelCol_Out)
>>
>> * over a cell, but not the same as last time
>> If nWhere_Out = 3 And nRelRow_Out # This.h_DynToolTipRow
>>
>> * temporarily activate first cell, so that .RelativeRow makes sense
>> lnColno = This.Parent.Columns(This.Parent.c_ActivateCellColumn).ColumnOrder
>> lnColno = lnColno + Iif(This.ColumnOrder = lnColno, 1, 0) - .LockColumns
>> If .RelativeRow = 0 Or .RelativeColumn # lnColno
>> .SetFocus()
>> .ActivateCell(Max(1, .RelativeRow), lnColno)
>> Endif
>>
>> * move to the record we're interested in
>> lnDiff = nRelRow_Out - .RelativeRow
>>
>> Try
>> Skip (lnDiff) In (.RecordSource)
>> Catch
>>
>> EndTry
>>
>> *******************************************************
>>
>> * temporarily on the right record ...
>> * so insert code to do something here ...
>>
>> *******************************************************
>>
>> Skip (-lnDiff) In (.RecordSource)
>> This.h_DynToolTipRow = nRelRow_Out
>> Endif
>> Endwith
>>Endproc
>>
>>
>>Procedure MouseLeave(nButton, nShift, nXCoord, nYCoord)
>> This.h_DynToolTipRow = 0
>> Try
>> Thisform.ShowTip()
>> Endtry
>>Endproc
>>
>>
>>>Is there still no way in vfp to get a grid to be aware of the mouse pointer over it? I want to be able to run the mouse over cells in a column and details from the record to be displayed elsewhere on the form, without each cell having to get clicked on, or getting focus. Thanks!
Jim Nelson
Newbury Park, CA