发信人: lofe ()感激生活(), 信区: BorlandDev
标  题: .在程序中动态创建组件
发信站: 哈工大紫丁香 (Mon Sep  4 16:13:30 2000), 转信

Var
MyButton : TButton;

MyButton := TButton.Create(MyForm); // MyForm now "owns" MyButton
with MyButton do
BEGIN
Parent := MyForm; // here MyForm is also the parent of MyButton
height := 32;
width := 128;
caption := 'Here I Am!';
left := (MyForm.ClientWidth - width) div 2;
top := (MyForm.ClientHeight - height) div 2;
END;

--
※ 修改:.haojs 于 Sep  4 16:11:06 修改本文.[FROM: bbs.hit.edu.cn]
--
※ 转寄:.武汉白云黄鹤站 bbs.whnet.edu.cn.[FROM: bbs.hit.edu.cn]

--
☆ 来源:.哈工大紫丁香 bbs.hit.edu.cn.[FROM: haojs.bbs@bbs.whnet.]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.445毫秒