冰壶运动有什么意思:delphi中label组件怎样与网页进行连接

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/06 00:32:21
有个写着网址的lable,想要在运行时可以实现类似超连接的效果

delphi6.0中

在uses单元里加上 shellapi

在事件中加入:

ShellExecute(handle,nil,pchar('http://free2.e-168.cn/delphi/soft'),nil,nil,SW_shownormal);

代码如下:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,shellapi;

type
TForm1 = class(TForm)
Label1: TLabel;
procedure Label1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Label1Click(Sender: TObject);
begin
ShellExecute(handle,nil,pchar('http://free2.e-168.cn/delphi/soft'),nil,nil,SW_shownormal);
end;

end.