Hi, Kroko,
folgendes habe ich gefunden, bzw. ist möglich:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60:
| procedure TForm1.ListBox1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var item: Integer; begin with Sender as TListbox do begin item := itemAtpos(Point(x, y), true); if item >= 0 then begin if hint <> items[item] then begin hint := items[item]; application.cancelhint; end; end; end; end;
procedure TForm1.ListBox1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var APoint: TPoint; Index: Integer; begin APoint.X := X; APoint.Y := Y; Index := ListBox1.ItemAtPos(APoint, True); if Index >= 0 then ListBox1.Hint := ListBox1.Items.Strings[Index]; end;
procedure TForm1.ListBox1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var APoint: TPoint; Index: Integer; HW: THintWindow; Rec: TRect; sHint: string; begin APoint.X := X; APoint.Y := Y; Index := ListBox1.ItemAtPos(APoint, True); if Index >= 0 then begin HW := THintWindow.Create(nil); try GetCursorPos(APoint); sHint := ListBox1.Items.Strings[Index]; Rec.Top := APoint.Y + 20; Rec.Left := APoint.X; Rec.Right := Rec.Left + HW.Canvas.TextWidth(sHint) + 6; Rec.Bottom := Rec.Top + HW.Canvas.TextHeight(sHint) + 4; HW.ActivateHint(Rec, sHint); HW.Refresh; Sleep(1000); HW.ReleaseHandle; finally HW.Free; end; end; end; |
Ich habe mich (zunächst) für den zweiten Vorschlag entschieden.
Vielen Dank für deinen Hinweis,
Detlef
P.S. Deine erste Idee ist doch besser

Grüße aus Lübeck, Detlef