VCL Delphi

procedure TForm1.ListBox1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
p: TPoint;
begin
p.x := x;
p.y := y;
ListBox1.ItemIndex := ListBox1.ItemAtPos(P, True);
end;