Hafedh TRIMECHE 1 Posted September 15, 2021 Is there a way to disable control resizing at design time? I tried this but Message.Result is always set to 1 (HTCLIENT) procedure TUFrame.WMNCHitTest(var Message:TWMNCHitTest); begin inherited; if Message.Result in [HTLEFT,HTRIGHT,HTBOTTOM,HTBOTTOMRIGHT,HTBOTTOMLEFT,HTTOP,HTTOPRIGHT,HTTOPLEFT] then Message.Result := Windows.HTNOWHERE; end; Thanks. Share this post Link to post
Rollo62 536 Posted September 16, 2021 Do you mean something like Anchor ? Share this post Link to post
Uwe Raabe 2057 Posted September 16, 2021 First there is the Lock Controls feature of the IDE, which prohibits any position or size changes during design for all controls. If we are talking about some specific controls made by yourself and registered in some design time package, you can override CanResize and return False when in design mode. function CanResize(var NewWidth, NewHeight: Integer): Boolean; override; ... function TMyControl.CanResize(var NewWidth, NewHeight: Integer): Boolean; begin if csDesigning in CompontentState then Result := False else Result := inherited CanResize(NewWidth, NewHeight); end; 1 Share this post Link to post