Search code examples
delphicontrolsflowpanel

TFlowPanel. Adding controls at run-time


Does anybody know how to add controls, say a TImage, to a TFlowPanel at runtime?

Regards, Pieter


Solution

  • To add any control to a parent control:

    MyControl := TMyControl.Create(MyForm); // Form is the owner
    MyControl.Parent := ParentControl;      // Parent control is the parent
    

    You can set other properties too if you like.