Link to home
Create AccountLog in
Avatar of mhervais
mhervais

asked on

speeding up the hint display

In a listbox, I wanted to code a hint on mousemove.

I coded this :

procedure TFMagicWinner.ListBox2MouseMove(Sender: TObject;
  Shift: TShiftState; X, Y: Integer);
var
  p : TPoint;
  itemnum : integer;
begin
  p.x := x;
  p.y := y;
  itemnum := listbox2.Itematpos(p, true);
  if itemnum > -1 then
  begin
      ListBox2.showhint := false;
      listbox2oldpos := itemnum;
      ListBox2.hint := ListBox2.Items[ItemNum];
      ListBox2.showhint := true;
  end;
end;
it works fine when I enter on the control, but when I move the mouse over it, the hint is not redisplayed.
The problem does not come from the mousemove event which is triggered correctly but from the fact that I cannot display the hint when I want.

I am sure somebody has a simple solution for that

ASKER CERTIFIED SOLUTION
Avatar of msedi
msedi

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of mhervais
mhervais

ASKER

Great answer Thank you very much