菜鸟求教:如何在窗体中建立超链接? 我想在关于窗体中加入一行网址,作为链接,当用户点击它时,就可以启动IE进入到该网站,请问如何作。最好给出示范代码。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 加一个普通的Label,将他的样式设定为蓝色,鼠标到那时,变成手形,这个你应该会把;然后,在他的click时间中写ShellExecute(handle,nil,pchar('http://www.sina.com.cn'),nil,nil,sw_shownormal); uses shellapi;procedure TForm1.Label4Click(Sender: TObject);beginShellexecute(handle,nil,pchar('http://www.163.com'),nil,nil,sw_shownormal);end; uses 中加入 ShellAPIprocedure TForm1.Label1Click(Sender: TObject);begin ShellExecute(Handle,'open','http://www.csdn.net.net','','',SW_SHOW)end; 把lable的caption属性输入你的网址.在onclick事件中输入ShellExecute(Application.Handle, nil, PChar(TLabel(Sender).Caption), nil, nil, SW_SHOWNORMAL); 再加上这个效果就更好了procedure TForm1.Label1MouseEnter(Sender: TObject);begin Label1.Font.Color := clBlue; Label1.Font.Style := [fsUnderline];end;procedure TForm1.Label1MouseLeave(Sender: TObject);begin Label1.Font.Color := clBlack; Label1.Font.Style := [];end; //超级连接效果procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);begin label1.Font.Style:=[fsbold,fsunderline]; label1.font.color:=clyellow;end;procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);begin label1.Font.Style:=[fsbold]; label1.font.color:=clmaroon;end;//打开网页,lable1的OnClick事件://记得 use shellapi;//只打开一个窗口ShellExecute(handle, '' , pChar('http://www.csdn.net'), '','', SW_SHOWNORMAL);//新建一个窗口ShellExecute(handle,'open','Explorer',pChar('http://www.csdn.net'),nil,SW_SHOW); ShellExecute(handle,nil,pchar('www.163.com'),nil,nil,sw_shownormal); 再把CurSor:=crHandPoint-------------------------------Microsoft OLE DB Provider for SQL Server 错误 '80040e31' 超时已过期 /Expert/reply.asp,行105 TBiDiMode属性是什么意思? 如何将二进制数转换为十六进制显示? 请问以下SQL语句如何在QUERY1里执行 socket常断问题! 怎样用Label显示DateTimePicker选中返回的日期 老问题:TQuery:插入一条记录提交后其他有记录会隐藏不见 dephi连接SYBASE出线的巨恶心问题,大侠帮帮忙吧 trackbar 的问题,简单的问题,只要回答都有分! 小妹?^_^?捉虫:关于分数!!!!!!! 向高手学习 能不能改成不用“元、角、分”呀?(100分等着你,在线等待) 哪有大量DSPack使用实例?英文的也可以
然后,在他的click时间中写
ShellExecute(handle,nil,pchar('http://www.sina.com.cn'),nil,nil,sw_shownormal);
begin
Shellexecute(handle,nil,pchar('http://www.163.com'),nil,nil,sw_shownormal);
end;
procedure TForm1.Label1Click(Sender: TObject);
begin
ShellExecute(Handle,'open','http://www.csdn.net.net','','',SW_SHOW)end;
ShellExecute(Application.Handle, nil, PChar(TLabel(Sender).Caption), nil, nil, SW_SHOWNORMAL);
procedure TForm1.Label1MouseEnter(Sender: TObject);
begin
Label1.Font.Color := clBlue;
Label1.Font.Style := [fsUnderline];
end;procedure TForm1.Label1MouseLeave(Sender: TObject);
begin
Label1.Font.Color := clBlack;
Label1.Font.Style := [];
end;
procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
label1.Font.Style:=[fsbold,fsunderline];
label1.font.color:=clyellow;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
label1.Font.Style:=[fsbold];
label1.font.color:=clmaroon;
end;
//打开网页,lable1的OnClick事件:
//记得
use shellapi;//只打开一个窗口
ShellExecute(handle, '' , pChar('http://www.csdn.net'), '','', SW_SHOWNORMAL);//新建一个窗口
ShellExecute(handle,'open','Explorer',pChar('http://www.csdn.net'),nil,SW_SHOW);
-------------------------------
Microsoft OLE DB Provider for SQL Server 错误 '80040e31' 超时已过期 /Expert/reply.asp,行105