Search code examples
delphidelphi-xe2autoresize

How to resize child controls when parent control is resized in delphi?


I have a delphi form with specific ClientHeight and ClientWidth and 2 panels on it with certain width and height. When I resize the form, I want the panels to be resized automatically on runtime. How can I do this? Is there any built-in feature present in delphi to resize the child controls when parent controls are resized or I have to program it?


Solution

  • Use the panel's Align and/or Anchors properties. They are designed for exactly this purpose.