![]() |
Drag and Drop
Hallo,
Ich mochte gerne das Verschieben einer Komponente per Drag&Drop realisieren. Allerdings finde ich keine wirklich passende Anleitung bei google oder hier im Forum. Gibt es da eine (einfache) Möglichkeit, wenn ja, wie lautet diese? |
Re: Drag and Drop
Ich hab jetzt folgenden Code gefunden:
Delphi-Quellcode:
Allerdings kennt er WM_SysCommand und ReleaseCapture nicht.
procedure TForm1.WinControlMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); begin if (Sender is TWinControl) then begin ReleaseCapture; //Fängt alle Mausereignisse ab TWinControl(Sender).Perform(WM_SysCommand, $F012, 0); end; end; Welche unit brauche ich da noch? |
Re: Drag and Drop
Hi,
für ReleaseCapture die unit Windows und für WM_SysCommand die unit Messages. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:13 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 by Thomas Breitkreuz