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.
解决方案 »
- 关于idtcp ReadBuffer 的问题
- 书上代码是不是有问题?
- 备份数据库SQL server 2000遇到的有点难道的问题.向高手请教
- 请教;怎样让一个下拉框既可以拉出数据库某个字段的所有值,又可以手工录入非数据库中的字段值?
- 用wm_copydata发送消息,竟然有消息丢失的现象,不解???
- 错误信息中文化!哪里有Delphi错误信息的中英文对照?
- 大家帮我看看这段代码,哪儿错了
- ODBC连接数据库时的鼠标指针
- 我的delphi6.0为什么不能使用midstr(),leftstr,rightstr()
- 在VB里ADO有个属性当记录指针EOF的时候选择是否增加,或者指针停在记录尾。。。。
- 请教关于从数据库中读取时间型数据的操作
- 我想学Delphi!
改成了'tiao',[TURLLabell]
同时对应的定义和代码里面的TURLLabel--------->TURLLabell
就是都在TURLLabel后面加多一个l就解决了问题!但是我如何要回我原来的TURLLabel这个名称啊?难道...永远石沉大海啊?