代码之家  ›  专栏  ›  技术社区  ›  Pieter van Wyk

TFlowPanel。在运行时添加控件

  •  2
  • Pieter van Wyk  · 技术社区  · 17 年前

    有人知道如何在运行时将控件(比如TImage)添加到TFlowPanel吗?

    你好,彼特

    2 回复  |  直到 17 年前
        1
  •  7
  •   Toon Krijthe    17 年前

    要将任何控件添加到父控件,请执行以下操作:

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

        2
  •  6
  •   eTomm eTomm    17 年前

    OldIndex:= FlowPanel.GetControlIndex( MyControl );     
    FlowPanel.SetControlIndex( MyControl, OldIndex + 1 );