Sehr rudimentär, auf jeden Fall noch ausbaufähig:
Delphi-Quellcode:
procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
panel: TPanel;
point: TPoint;
begin
panel := Sender as TPanel;
point := panel.ScreenToClient(Mouse.CursorPos);
panel.Tag := Integer((point.X > panel.Width - 10) or (point.Y > panel.Height - 10));
end;
procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
panel: TPanel;
point: TPoint;
begin
panel := Sender as TPanel;
if Boolean(panel.Tag) then
begin
point := panel.ScreenToClient(Mouse.CursorPos);
panel.Width := point.X;
panel.Height := point.Y;
end;
end;
procedure TForm1.Panel1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
panel: TPanel;
begin
panel := Sender as TPanel;
panel.Tag := Integer(false);
end;