Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Algorithmen, Datenstrukturen und Klassendesign (https://www.delphipraxis.net/78-algorithmen-datenstrukturen-und-klassendesign/)
-   -   Delphi Move Panel (https://www.delphipraxis.net/174270-move-panel.html)

danten 13. Apr 2013 07:57

Move Panel
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hi all.
I have a form in it Panel1 and therein PanelA + PanelB + PanelC.

panelA = alLeft, panelB = alLeft, panelC = alLeft.
I need to drag the mouse to change the position of the panel (A, B or C).

Anhang 38959

Thanks all.

Perlsau 13. Apr 2013 08:29

AW: Move Panel
 
Where is your problem?

danten 13. Apr 2013 08:39

AW: Move Panel
 
When I use PanelA.MouseDown, so panel moves, but when MouseUp not aligned alLeft.
Delphi-Quellcode:
procedure Tmain.PanelAMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then
begin
  ReleaseCapture ();
  SendMessage (PanelA.Handle, $ A1, 2, 0);
end;

procedure Tmain.PanelAMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
 ???? EndCapture ??? 
end;

Perlsau 13. Apr 2013 08:48

AW: Move Panel
 
Sorry, I don't understand your code and what it should do ...

Bummi 13. Apr 2013 08:50

AW: Move Panel
 
Delphi-Quellcode:
procedure TForm6.AllPanelsMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
   ReleaseCapture;
   sendmessage(TPanel(Sender).Handle, WM_NCLBUTTONDOWN, 2, 0);
   Realign;
end;

danten 13. Apr 2013 08:57

AW: Move Panel
 
Zitat:

Zitat von Bummi (Beitrag 1211343)
Delphi-Quellcode:
procedure TForm6.AllPanelsMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
   ReleaseCapture;
   sendmessage(TPanel(Sender).Handle, WM_NCLBUTTONDOWN, 2, 0);
   Realign;
end;

OK, that's fine.Do I need the OnMouseUp to moving the panel aligned alLeft.

danten 13. Apr 2013 09:12

AW: Move Panel
 
OK, solved.
Delphi-Quellcode:
if Button = mbLeft then
  begin
    ReleaseCapture();
    sendmessage(TPanel(Sender).Handle, WM_NCLBUTTONDOWN, 2, 0);
    Realign;
    TPanel(Sender).Align := alLeft;
  end;
Thanks all.
Daniel


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:30 Uhr.

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