请问怎样动态创建一个panel 请问怎样动态创建一个panel 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 a:tpanel1;begin a:= tpanel1.create(nil); a......//or with tpanel1.create(nil) do begin try .... finally freeandnil(); end;end 1)还需要指定该panel的位置(Left,Top),大小(Width,Height),Parent,Name;2)建议将TPanel.Create()的参数设置为所在的Form3)之前声明的TPanel型变量只是个指针,应该对刚生成的Panel的Name赋值,以便于别的下次引用.4)记得必要时要主动释放. Tpanel.Create(Self).Name := 'panel1';//命名 with Tpanel(FindComponent('panel1')) do begin Left := 10; Top := 20; Parent := self; end; // 我都是用这这种方法来建立,动态控件的,当然也包括Form// 个人觉得这种方法是最好的Var Panel : TPanel ;Begin Panel := TPanel.Create(nil) ; // nil 也可为 Self 或 Form Panel.Top := 100 ; Panel.Left := 100 ; Panel.Height := 100 ; Panel.Width := 100 ; .............End ; 怎么转换大小端? 关于WinSocket求助 DBEXPRESS的SQLConnection1怎样用代码来连接数据库? fctreeview带checkbox的状态下如何实现像杀毒软件选择目录那样的效果 多线程问题,请高手进来指点一下。 什么原因!!!!急!!! 请问如何让程序在制定的点,停止一秒在执行. 请较文件的拖放的问题?还望大家指教! sql插入系统时间的问题,送分啦 Paradox数据表在Database Desktop中和在Dbgrid中显示的数值不一样. [求助]请问从哪里可以下载到一些使用三层结构的源码? 两个线程访问同一个变量如果保证正确性呢?
begin
a:= tpanel1.create(nil);
a......
//or
with tpanel1.create(nil) do
begin
try
....
finally
freeandnil();
end;
end
2)建议将TPanel.Create()的参数设置为所在的Form
3)之前声明的TPanel型变量只是个指针,应该对刚生成的Panel的Name赋值,以便于别的下次引用.
4)记得必要时要主动释放.
with Tpanel(FindComponent('panel1')) do
begin
Left := 10;
Top := 20;
Parent := self;
end;
// 个人觉得这种方法是最好的
Var
Panel : TPanel ;
Begin
Panel := TPanel.Create(nil) ; // nil 也可为 Self 或 Form
Panel.Top := 100 ;
Panel.Left := 100 ;
Panel.Height := 100 ;
Panel.Width := 100 ;
.............
End ;