Author: Tomas Rutkauskas
How do I force hints to be shown where I want? The hint for a stringgrid currently
is showing up right below it, where it doesn't get noticed if the user is moving
his/ her mouse over the top of the grid and the grid is large. Ideally I'd want
that little yellow boxed hint to show as close to the cursor as possible.
Answer:
1 2 procedure TArrangerForm.AppShowHint(var HintStr: string; var CanShow: Boolean;
3 var HintInfo: THintInfo);
4 var5 i: integer;
6 begin7 with HintInfo do8 begin9 if (HintControl = LocatorPanel1) then10 with LocatorPanel1 do11 begin12 ifnot (csLButtonDown in ControlState) then13 begin14 i := FindListMarker(CursorPos.X);
15 if (i >= 0) then16 begin17 HintPos :=
18 ClientToScreen(Point(TimeToPixel(MarkerList.Markers[i].Offset) + 10, 2));
19 Application.HintPause := 0;
20 Application.HintHidePause := MaxInt;
21 CanShow := True;
22 exit;
23 end;
24 end;
25 CanShow := False;
26 end;
27 end;
28 Application.HintPause := 800;
29 Application.HintHidePause := 2500;
30 end;