Thanks much, Dave.
I've setup a test case based on your code, and what's happening (at
least for me) is that MyGridHit is only getting activated when I click
on a cell in the grid, and then the tooltip is displayed when I hover
over that and other cells in the column, but to change the tooltip I
have to click a different cell. Is that your design? I was hoping to be
able to change the tooltip merely by hovering the mouse over a cell
(without 1st clicking anywhere). That was the initial idea anyway, but
now I'm beginning to think that this approach may be okay.
You're right, it is fun! I'm just feeling a little under the gun to get
a lot of stuff done, so can't take too much time to stop and appreciate
these wonders :)
Bill
> Bill,
> I implemented this in my Organizer project and had a bit of
> fun finding out how to do it. What you need to do is set up
> an external Method say MyGridHitTest on the grid or form and
> then bind this method to the to the Mouseover event of the
> colum ns in the grid.
>
>
> * Bind the Thisform.MyGridhit() to each column to display tooltips
> =BindEvent(.Columns[I],"MouseMove",Thisform,"MyGridHit")
>
> Now we look at the MyGridHit() User method.
> In it we use the GridHitTest which will give back coordinates
> of the relative row/column. Activate the live cell then force
> in the tooltip text using Eval()
>
> * Thisform.MyGridHit()
> With Thisform.grdData
> * See where we are in the grid
> .GridHitTest(nxCoord_In, nYCoord_In, ;
> @nWhere_Out,@nRelRow_Out,@nRelCol_Out, @nView_Out)
>
> * Display full tooltip if we are in column 1, 2 or 3
> If InList(nRelCol_Out,1,2,3)
> .ActivateCell(nRelRow_Out,nRelCol_Out)
>
> cCursor=.RecordSource
>
> cTooltip=Evaluate("Alltrim("+cCursor+"<fieldname>"+")")
>
> .Columns[1].Tooltiptext=(cTooltip)
> ...
> ...
>
> I used the Evaluate() function in order to dynamically change
> the tooltip from row to row but you can obviously load the
> cTooltip variable with whatever you want.
>
> Hope this helps.
>
> Dave Crozier
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.