Implement the movement of the control, change the size (Delphi implementation)
Mainly use Perform method Function Perform (Msg: Cardinal; WPARAM, LPARAM: longint): longint; This method can also be applied in other environments using functions similar to Win32API.
Using Delphi to create an application, join a PANEL1 in a form, save to main.pas; then move in Panel1 mouse, the mouse is added to the event; mouse movement: Control the shape of the cursor Procedure TFORM1.PANEL1MOUSEMOVE (Sender: Tobject; Shift: TshiftState; x, y: integer; begin if (x> = 0) and (x <= 3) THEN BEGIN IF (Y> = 0) and (y <= 3) Then Panel1.cursor: = Crsizenwse; if (y> 3) And (Y
Mouse Press: Control Panel's size or position procedure tForm1.Panel1Mousedown (Sender: Tobject; button: tmousebutton; shift: tshiftstate; x, y: integer; begin ReleaseCapture; if (x> = 0) and (x <= 3) ) THEN BEGIN FILE: // Left upper corner change Size if (Y> = 0) and (y <= 3) Then Panel1.Perform (WM_SYSCOMMAND, $ F004, 0); file: // Left side IF (Y> 3 And (Y
Unit main;
Interface
Uses Windows, Messages, Sysutils, Classes, Graphics, Controls, Forms, Dialogs, Stdctrls, ExtCtrls
type TForm1 = class (TForm) Panel1: TPanel; procedure Panel1MouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure Panel1MouseMove (Sender: TObject; Shift: TShiftState; X, Y: Integer) PRIVATE {Private Declarations} end; var form1: tform1;
IMPLEMENTATION
{$ R * .dfm}
Procedure TForm1.Panel1Mousedown (Sender: Tobject; Button: TMouseButton; Shift: TshiftState; x, y: integer; begin ReleaseCapture; if (x> = 0) and (x <= 3) Then Begin if (y> = 0) And (y <= 3) THEN PANEL1.PERFORM (WM_SYSCOMMAND, $ F004, 0); if (Y> 3) and (Y
Procedure TForm1.Panel1Mousemove (Sender: Tobject; Shift: TshiftState; x, y: integer); begin if (x> = 0) and (x <= 3) THEN BEGIN IF (Y> = 0) AND (Y <= 3) ........................................................................... .. .HEIGHT) THEN Panel1.cursor: = CrsizENESW; END ELSE IF (x> 3) And (x
HWND HWND, // Handle of Destination Window Uint Msg, // Message To Send WParam WPARAM, // First Message Parameter Lparam Lparam // Second Message Parameter
2001.9.27