【发布时间】:2013-06-03 20:58:04
【问题描述】:
我在运行时创建嵌套组件。如何在with 中分配子组件的Parent 属性?
with Tspanel.Create(categorypanel) do
begin
parent:=categorypanel; // categorypanel, is a declared variable
height:=30;
visible:=true;
button1 := tsbutton.Create();
// Here is my problem! I want the parent to be the
// panel I've created with the "with tspanel.create(...)"
button1.Parent := ...
end;
我的目标是不为每个组件声明变量。
【问题讨论】:
-
'我的目标是不为每个组件声明变量' - 为什么不呢?
标签: delphi with-statement