TFlowPanel. 在运行时添加控件

3

有没有人知道如何在运行时将控件,比如TImage,添加到TFlowPanel中?

问候,Pieter

2个回答

7

向父控件添加任何控件的方法:

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

如果您愿意,您还可以设置其他属性。


7

与普通容器相比,这种容器的唯一区别就是可以设置子控件的顺序。

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接