我想给自己的控件加一个ImageList和ImageIndex属性,选中ImageList后,在属性ImageIndex中显示图片,就像Toobar之类的那样

  • 主题发起人 留香客
  • 开始时间

留香客

Unregistered / Unconfirmed
GUEST, unregistred user!
我想给自己的控件加一个ImageList和ImageIndex属性,选中ImageList后,在属性ImageIndex中显示图片,就像Toobar之类的那样 ( 积分: 100 )<br />我想给自己的控件加一个ImageList和ImageIndex属性,选中ImageList后,在属性ImageIndex中显示图片,就像Toobar之类的那样
ImageIndex是一个TImageIndex,而TImageIndex是一个integer.我的published是这样声明的:
private
FImageList:TCustomImageList;
FHotImage:TImageIndex;
published
property ImageList:TCustomImageList read FImageList write SetImageList;
property HotImage:TImageIndex read FHotImage write SetImage;
 
你得控件是从什么类继承过来的,如果父类有这些东西,你继承下来就是了
 
你得控件是从什么类继承过来的,如果父类有这些东西,你继承下来就是了
 
我是从TCustomControl继承下来的,这个没有这个属性的
看了delphi的源码老是找不到头绪。
 
taa=classes(TCustomControl)
private
FImageList:TImageList;
FHotImage:TImageIndex;
published
property ImageList:TImageList read FImageList;
property HotImage:TImageIndex read FHotImage write SetImage;
public
Constructor Create(AOwner:TComponent);override;
Destructor Destroy;override;
end;

Constructor taa.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
FImageList:=timagelist.create(self);
end;

Destructor taa.Destroy;
begin
FImageList.free;
inherited Destroy ;
end;
 
hs-kill理解错了
我是想问在控件属性页中 ImageIndex 设置成列表 中显示图片的样子。
 
啊? 汗.....呵呵
 

Similar threads

顶部