|
|
导航: |
论坛 -> 发布控件
斑竹:liumazi,ruralboy |
|
作者: |
|
2005/3/26 0:58:04 |
标题: |
Label和SpeedButton的绑定问题,谢谢大家!! |
浏览:1887 |
|
加入我的收藏 |
楼主: |
这是一个继承TSpeedButton的一个控件,我添加了一个Label属性,但是在把这个 控件添加到Form时,为什么在Form的任何地方都看不到Label呢? 请高人指点一下!谢谢 unit SpeeLabel;
interface
uses SysUtils, Classes, Controls, Buttons, StdCtrls;
type TSpeeLabel = class(TSpeedButton) private FKeyLabel: TLabel; { Private declarations } protected { Protected declarations } public { Public declarations } constructor Create(AOwner: TComponent);override; published { Published declarations } property KeyLabel: TLabel read FKeyLabel; end;
procedure Register;
implementation
procedure Register; begin RegisterComponents('KTButton', [TSpeeLabel]); end;
{ TSpeeLabel }
{ TSpeeLabel }
constructor TSpeeLabel.Create(AOwner: TComponent); begin inherited; FKeyLabel := TLabel.Create(Self); FKeyLabel.SetSubComponent(True); FKeyLabel.Parent := Self.Parent; FKeyLabel.Visible := True; end;
end.
----------------------------------------------
- |
|