Author: Tomas Rutkauskas How to resize a TPanel at runtime Answer: Solve 1: You should add a SIZEBOX constant to the your panel window style: 1 TMyNewPanel = class(TPanel) 2 { ... } 3 procedure CreateParams(var Params: TCreateParams); override; 4 { ... } 5 6 procedure TMyNewPanel.CreateParams(var Params: TCreateParams); 7 begin 8 inherited CreateParams(Params); 9 Params.Style := Params.Style or WS_SIZEBOX; 10 end; Solve 2: The best way to deal with this is to make a descendent of TPanel that incorporates the required behaviour. Copy the following to a file SizeablePanel.pas, and install that via Component -> Install component. 11 unit SizeablePanel; 12 13 interface 14 15 uses 16 Messages, Windows, SysUtils, Classes, Controls, ExtCtrls; 17 18 type 19 TSizeablePanel = class(TPanel) 20 private 21 FMoveable: Boolean; 22 procedure wmNCHittest(var msg: TWMNCHittest); message WM_NCHITTEST; 23 published 24 property Moveable: Boolean read FMoveable write FMoveable default false; 25 end; 26 27 procedure register; 28 29 implementation 30 31 procedure register; 32 begin 33 RegisterComponents('PBGoodies', [TSizeablePanel]); 34 end; 35 36 procedure TSizeablePanel.wmNCHittest(var msg: TWMNCHittest); 37 var 38 bottom, right: Integer; 39 pt: TPoint; 40 begin 41 if moveable then 42 msg.result := HTCAPTION 43 else 44 inherited; 45 pt := parent.ScreenToClient(SmallpointToPoint(msg.Pos)); 46 bottom := Top + Height; 47 right := Left + Width; 48 if (pt.x - Left) < 10 then 49 if (pt.y - Top) < 10 then 50 msg.Result := HTTOPLEFT 51 else if (Bottom - pt.y) < 10 then 52 msg.result := HTBOTTOMLEFT 53 else 54 msg.result := HTLEFT 55 else if (right - pt.x) < 10 then 56 if (pt.y - Top) < 10 then 57 msg.Result := HTTOPRIGHT 58 else if (Bottom - pt.y) < 10 then 59 msg.result := HTBOTTOMRIGHT 60 else 61 msg.result := HTRIGHT 62 else if (pt.y - Top) < 10 then 63 msg.Result := HTTOP 64 else if (Bottom - pt.y) < 10 then 65 msg.result := HTBOTTOM; 66 end; 67 68 end.