📄 怎样在运行时刻动态生成控件 (2000年12月21日).txt
字号:
怎样在运行时刻动态生成控件? (2000年12月21日)
本站更新 分类: 作者:srw 推荐: 阅读次数:461
(http://www.codesky.net)
--------------------------------------------------------------------------------
怎样在运行时刻动态生成控件[可视的和不可视的]
㈠、可视控件:[以下以 TEdit 控件为例]
1.在Form的Public 中定义TEdit控件
Edit1:TEdit;
2.在需要生成的地方加入以下代码:
Edit1:=TEdit.Create(Self);
Edit1.Parent:=Form1; ?// Set parent to paint the Edit1
Edit1.Left ?:=20; ?// Set postion
Edit1.Top :=20;
Edit1.Text :='Edit1 Text'; // Set values
.... ? // Set other property
3.使用完毕后,释放分配的资源
if? Assigned(Edit1) then
Edit1.Free; ?
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -