组件制作之二(一个简单组件的制作过程)[11]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 linzhengqun 的 blog

//最重要的时间函数,用于调用该类的事件触发高度函数。

//以及在容器中显示计数值

procedure ttimecount.ftimertimer(sender:tobject);

begin

  inc(fcount);

  if (fcount mod 3600)=0 then fcount:=0;

  caption:=inttostr(fcount);//这个就是显示计数值

  inc(timenum);

  if (timenum=timelen)and(factive) then

  begin

       dotimeout;

       timenum:=0;

  end;

end;

//事件调度函数,将外部的事件处理函数和该类的事件方法指针联系起来

procedure ttimecount.dotimeout;

begin

  if assigned(ftimeout) then

     ftimeout(self);

end;

 

end.

 

五,组件注册安装与删除。

 

组件类编写完毕,接着就要测试了,这个从略,可以在刚才的工程中动态创建它,设置相应属性,指定时间事件,看看是否正确。上面是经过测试的。

到确定正确后,就要来看看装组件的步骤了:

本文关键:组件制作之二(一个简单组件的制作过程)
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top