保存桌面快捷方式 - - 设为首页 - 手机版
凹丫丫旗下网站:四字成语大全 - 故事大全 - 范文大全
您现在的位置: 范文大全 >> 理工论文 >> 计算机信息技术 >> 正文

创建自己的Dephi构件


1. 选中Component菜单项中的 New  Component选项,在 Ancestor Type 框填入Tlabel,在 Class Name框中填入 TnewLabel ,在 Palette Page框中填入  Samples,在 Unit File Name 框中填入 NewCom.pas ,然后单击按钮 Create Unit就进入到代码编辑状态。

2. 使用 Tools菜单中Image Editor来创建编辑文件NewCom.dcr,为   TnewLabel类建立位图。

3. 增加新属性EnterTextColor ,并为读写属性增加私有方法 SetEnterTextColor和私有变

量 FenterTextColor。

加入如下的代码:

Private

    FenterTextColor : Tcolor;

    SetEnterTextColor(Acolor :Tcolor);

Published

Property  EnterTextColor : Tcolor

Read  FenterTextColor  Write  SetEnterTextColor(Acolor);

Implementation

 

Procedure  TnewLabel.SetEnterTextColor(Acolor :Tcolor);

Begin

FEnterTextColor:=Acolor;

                End;

《创建自己的Dephi构件(第3页)》
本文链接地址:http://www.oyaya.net/fanwen/view/142642.html

★温馨提示:你可以返回到 计算机信息技术 也可以利用本站页顶的站内搜索功能查找你想要的文章。