Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Drag and Drop (https://www.delphipraxis.net/90899-drag-drop.html)

R2D2 25. Apr 2007 18:39


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?

R2D2 25. Apr 2007 19:07

Re: Drag and Drop
 
Ich hab jetzt folgenden Code gefunden:
Delphi-Quellcode:
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;
Allerdings kennt er WM_SysCommand und ReleaseCapture nicht.

Welche unit brauche ich da noch?

bitsetter 25. Apr 2007 20:14

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 05:13 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz