VB 在RichText中插入OLE对象

来源:百度知道 编辑:UC知道 时间:2024/05/25 11:03:36
如题

到这里看看
http://www.dearbook.com.cn/book/14333

运行时生成控件
一、运行时生成可视控件:以下以Tedit 控件为例
1.在Form的Public中定义Tedit控件
Edit1:Tedit;
2.在需要生成的地方加入以下代码:
Edit1:=Tedit.Create(Self);
Edit1.Parent:=Form1;
Edit1.Left ?:=20;
Edit1.Top :=20;
Edit1.Text :='Edit1 Text';
3.使用完毕后,释放分配的资源
if? Assigned(Edit1) then Edit1.Free; ?
二、运行时生成非可视控件:以下以 Ttimer控件为例
1.在Form的Public中定义Ttimert控件
Timer1:Ttimber;
2.在需要生成的地方加入以下代码:
Timer1:=Ttimer.Create(Self);
Timer1.OnTimer:=YourAction;
YourAction是自己定义的OnTimer事件,使用
procedure TForm1.YourAction(Sender:Tobject); 完成
3.使用完毕后,释放分配的资源
if? Assigned(Timer1) then Timer1.Free; ?

看看这里吧,
http://zhidao.baidu.com/question/38603991.html?fr=qrl