新建工程,加两个label组件
uses shellapi
uses shellapi;
{$R *.dfm}
procedure URLink(URL:PChar);//定义一个过程
begin
ShellExecute(0, nil, URL, nil, nil, SW_NORMAL);
end;
procedure TForm1.FormCreate(Sender: TObject);//窗口初始化
begin
label1.Caption:='http://www.cnitblog.com/shuyezi122';
label2.Caption:='shuyezi122@163.com';
label1.Font.Color:=clblue;
label2.Font.Color:=clblue;
label1.Cursor:=crHandPoint;
label2.Cursor:=crHandPoint;
end;
procedure TForm1.Label1Click(Sender: TObject);
begin
URLink('http://www.cnitblog.com/shuyezi122');
end;
procedure TForm1.Label2Click(Sender: TObject);
begin
URLink('mailto:shuyezi122@163.com');
end;
procedure TForm1.Label1MouseEnter(Sender: TObject);
begin
Label1.Font.Color:=clred;
end;
procedure TForm1.Label1MouseLeave(Sender: TObject);
begin
Label1.Font.Color:=clblue;
end;
procedure TForm1.Label2MouseEnter(Sender: TObject);
begin
Label2.Font.Color:=clred;
end;
procedure TForm1.Label2MouseLeave(Sender: TObject);
begin
Label2.Font.Color:=clblue;
end;
end.
这些一看就明白了吧
posted on 2009-01-21 03:25
小叶子 阅读(246)
评论(0) 编辑 收藏 引用 所属分类:
笔记