unit URLLabel;interfaceuses
Windows,
SysUtils,
Messages,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
Menus,
StdCtrls,
Shellapi,
ExtCtrls;
{QGraphics模块是Font.Style:= [fsUnderline];必须用的
Shellapi模块是ShellExecute必须用的
Forms模块是Application必须用的
Windows模块是SW_NORMAL必须用的}
type
TURLLabel = class(TLabel)
private
{ Private declarations }
FUrl: String;
protected
{ Protected declarations }
procedure Click;override;
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
{ Published declarations }
property Url: String read FUrl write FUrl;
end;procedure Register;implementationconstructor TUrlLabel.Create(AOwner:TComponent);
begin inherited Create(AOwner); Cursor:=crHandPoint; Font.Style:= [fsUnderline];
end;
procedure TUrlLabel.Click;begin ShellExecute(Application.Handle, nil, PChar(Url), nil, nil,SW_NORMAL); inherited;end;
destructor TUrlLabel.Destroy;
begin
inherited Destroy;
end; { Destroy }procedure Register;
begin
RegisterComponents('Arvid', [TURLLabel]);
end;end.
Windows,
SysUtils,
Messages,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
Menus,
StdCtrls,
Shellapi,
ExtCtrls;
{QGraphics模块是Font.Style:= [fsUnderline];必须用的
Shellapi模块是ShellExecute必须用的
Forms模块是Application必须用的
Windows模块是SW_NORMAL必须用的}
type
TURLLabel = class(TLabel)
private
{ Private declarations }
FUrl: String;
protected
{ Protected declarations }
procedure Click;override;
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
{ Published declarations }
property Url: String read FUrl write FUrl;
end;procedure Register;implementationconstructor TUrlLabel.Create(AOwner:TComponent);
begin inherited Create(AOwner); Cursor:=crHandPoint; Font.Style:= [fsUnderline];
end;
procedure TUrlLabel.Click;begin ShellExecute(Application.Handle, nil, PChar(Url), nil, nil,SW_NORMAL); inherited;end;
destructor TUrlLabel.Destroy;
begin
inherited Destroy;
end; { Destroy }procedure Register;
begin
RegisterComponents('Arvid', [TURLLabel]);
end;end.
改成了'tiao',[TURLLabell]
同时对应的定义和代码里面的TURLLabel--------->TURLLabell
就是都在TURLLabel后面加多一个l就解决了问题!但是我如何要回我原来的TURLLabel这个名称啊?难道...永远石沉大海啊?