通过实例看VCL组件开发全过程(二)[1]

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

本文简介:选择自 hkbarton 的 blog

(接上文)

组件的代码由于假设你已经熟悉delphi开发(它和一般开发没什么不同),我们就直接贴出来并加上适当的注释:

 

unit clock;

 

interface

 

uses

  sysutils, classes, controls, stdctrls,extctrls;

 

type

  tstate=(stclock,strunclock,stbackclock);//定义枚举类表示控件的3种状态:时钟、跑表、倒计时钟

 

  tclock = class(tcustomlabel)

  private

    fstate:tstate;

    ftimer:ttimer;//为什么使用这个组件作为我们组件的私有成员就不用说了吧

    rcd:array[1..8] of integer;//跑表中的各个数位。

本文关键:VCL,组件开发
 

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

go top