InsertComponent和InsertControl的区别
来源:互联网 发布:公司宣传片制作软件 编辑:程序博客网 时间:2024/05/21 18:41
IsertComponent是向从组件列表添加新组件
InsertControl是向当前组件的子组件列表添加新组件。
从组件和子组件是什么东西?
以及Owner和Parent的区别。
TWinControl-RemoveControl、InsertControl
Delphi 2010-11-06 // TWinControl类都有这两个方法
//RemoveControl和InsertControl都针对可视控件
//Procedure RemoveControl(AControl: TControl);
//Procedure InsertControl(AControl: TControl);
procedure TForm1.Button1Click(Sender: TObject);
begin
if Button1.Parent<>GroupBox1 then
begin
//将Button1从TForm1.Controls数组中删除
Self.RemoveControl(Button1);
//使用前提就是:Button1类已在内存中注册
GroupBox1.InsertControl(Button1);
//将Button1添加到GroupBox1.Controls数组中去
Button1.Left:=20;
Button1.Top:=20;
end;
end;
//使用以下方法也可以达到同样效果
procedure TForm1.Button2Click(Sender: TObject);
begin
Button1.Parent:=GroupBox1;
Button1.Left:=20;
Button1.Top:=20;
end;
http://www.delphibbs.com/keylife/iblog_show.asp?xid=30175
- InsertComponent和InsertControl的区别
- 和和的区别
- & 和 &&、|和||的区别:
- &和&&、|和||的区别
- &&和&,||和|的区别
- &和&&、|和||的区别
- &和&&、|和||的区别
- ../和./和/的区别
- &和&&,|和||的区别
- "&"和"&&"、"|"和"||"的区别
- &和&& |和||的区别
- &和&&的区别 |和||的区别
- &&和&的区别,||和|的区别
- &和&&的区别以及|和||的区别
- &&和&的区别? | | 和|的区别?
- &和&&的区别,|和||的区别
- &和&&的区别及!和~区别
- '&'和'*' (C++)的区别
- Android学习04视频的播放
- Android多媒体学习十五:使用在内置的Camera录制视频
- Linq To XML:用名称查找元素
- Java Web开发框架的未来为什么是Struts2?(
- discuzX1.5制作单页教程
- InsertComponent和InsertControl的区别
- 在ClearQuest环境中查看DataDirect的版本
- CustomValidator自定义验证控件
- java解析zigbee协议
- android ScrollView 和 HorizontalScrollView 的使用
- oracle 11g 常用命令
- android响应事件的三种方式
- 用ExpandableListView+Dialog 仿Spinner
- android ScrollView 和 HorizontalScrollView 的使用