C
Cheasy
Unregistered / Unconfirmed
GUEST, unregistred user!
TLabel2 继承其 TLabel.
目标创建 TLabel2)
1. 将 AutoSize 属性默认 True 改为 False.
2. 从控件在创建的时候,在左边有一条红色的边线.
就两个,学习目的是: 修改源属性,和在create时如何调用方法...
unit Label2;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, StdCtrls;
type
TLabel2 = class(TLabel)
private
{ private declarations}
protected
{ Protected declarations }
public
constructor Create (AOwner: TComponent); override;
destructor Destroy; override;
published
{...}
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Standard', [TLabelView]);
end;
{构造}
constructor TLabelView.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
end;
{析构}
destructor TLabelView.Destroy;
begin
inherited Destroy;
end;
end.
请指教~ 谢谢大家!
目标创建 TLabel2)
1. 将 AutoSize 属性默认 True 改为 False.
2. 从控件在创建的时候,在左边有一条红色的边线.
就两个,学习目的是: 修改源属性,和在create时如何调用方法...
unit Label2;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, StdCtrls;
type
TLabel2 = class(TLabel)
private
{ private declarations}
protected
{ Protected declarations }
public
constructor Create (AOwner: TComponent); override;
destructor Destroy; override;
published
{...}
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Standard', [TLabelView]);
end;
{构造}
constructor TLabelView.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
end;
{析构}
destructor TLabelView.Destroy;
begin
inherited Destroy;
end;
end.
请指教~ 谢谢大家!