![]() |
[AV] Listbox: Drag&Drop
Hi,
ich habe eine Listbox namens lbKat mit DragMode auf dmAutomatic. Wenn ich einen Eintrag in der Listbox verschiebe bekomme ich eine Zugriffsverletzung. Habt ihr eien Idee warum ?
Delphi-Quellcode:
private
{ Private-Deklarationen } StartingPoint : TPoint; ... procedure TfrmSettings.lbKatStartDrag(Sender: TObject; var DragObject: TDragObject); var CurPos : TPoint; begin if (GetCursorPos(CurPos)) then begin StartingPoint.X := CurPos.X; StartingPoint.Y := CurPos.Y; end; end; procedure TfrmSettings.lbKatDragDrop(Sender, Source: TObject; X, Y: Integer); var DropPoint : TPoint; DropPosition, StartPosition : Integer; begin DropPoint.X := X; DropPoint.Y := Y; with Source as TListBox do begin StartPosition := ItemAtPos(StartingPoint, True); DropPosition := ItemAtPos(DropPoint, True); lbKat.Items.Move(StartPosition, DropPosition); end; end; |
Re: [AV] Listbox: Drag&Drop
Hallo Nils,
ohne deinen Source groß angeguckt zu haben könnte dich ![]() Grüße |
Re: [AV] Listbox: Drag&Drop
Danke, so ist er zwar länger aber auch schöner :)
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:20 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz