中国程序员联盟 正在重新改版中ing 不便之处还请见谅 改版后将内容涉及java delphi .net php
 
  首页 | 数据库开发 | 网络通讯 | 多线程 | 多媒体开发 | 图像处理 | 程序人生 | 系统函数 | 控件开发 | Web服务
 
  当前位置:笨鱼delphi技术网>控件开发>控件使用>文章内容

delphi delphi下对象类别检查

来源:国外 关于:Pablo Reyes 发布时间:2007-07-21   [收藏] [推荐]
1. To instruct Delphi which category a property belongs to:
We have to do that in the Register procedure. The function RegisterPropertyInCategory has four overloaded versions. This is one of them. In this version we instruct Delphi to assign the property "Version" of our component "TMyButton" to the "TMiscellaneousCategory" standard category.
procedure Register;
begin
  RegisterComponents('Samples', [TMyButton]);
  RegisterPropertyInCategory(TMiscellaneousCategory, TMyButton, 'Version');
end;
Search Delphi help for more information about other overloaded versions of this function.
2.To create our own category:
We have to create a new class and derive it from TPropertyCategory or one of the existing categories (for example TMiscellaneousCategory). Then, we need to override the Name class function. The result value is the name shown by the object inspector.
interface
TMyCategory = class(TPropertyCategory)
public
  class function Name: string; override;
end;
implementation
class function TMyCategory.Name: string;
begin
  Result := 'My Category';
end;
Then we could use our new category.
procedure Register;
begin
  RegisterComponents('Samples', [TMyButton]);
  RegisterPropertyInCategory(TMyCategory, TMyButton, 'Version');
end;
You can also use RegisterPropertiesInCategory to register more than one property with one category at a time.

[浏览: 次]   
上一篇:delphi 组件序列化   下一篇:delphi Olevariant
[收藏] [推荐] [返回顶部] [打印本页] [关闭窗口]  
    评论加载中…
google adsense热点文章
·delphi treeview 使用
·delphi 组件序列化
·delphi 如何在DBGRID里添加行序号
·delphi 组件用户自定义设计期工具
·delphi 显示GRID单Cell框的Hint
·delphi 如何保存属性到运行期使用(上)
·delphi 组件序列化
·delphi 如何将系统所有菜单列到树上Tre
·delphi 如何保存属性到运行期使用(下)
·delphi 如何将属性在设计期保存到DFM文
·delphi 如何保存Blob类型字段到数据库
·delphi VCL控件机制与VCL.net控件机制
     delphi技术网 | firefox 下载 | Avant Browser下载 | dedecms 技术网 | drupal 爱好者 | php 技术网
  Copyright@www.delphichm.com,2006-2009.All Rights Reserved.
 
程序员联盟 | delphi Java .net|QQ:707102932