请问如果做个点击label直接连到某个网站

wuhc2002 2004-11-27 11:04:11
如题
...全文
135 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
DemonLoveLizzy 2004-11-28
  • 打赏
  • 举报
回复
//ShellExecute(Handle,nil,'http://www.ksaiy.com',nil,nil,SW_SHOWNORMAL);

ShellExecute(Handle,'open','http://www.ksaiy.com',nil,nil,SW_SHOWNORMAL);
「已注销」 2004-11-28
  • 打赏
  • 举报
回复
同意楼上,还做了超链的效果
gyf 2004-11-28
  • 打赏
  • 举报
回复
ShellExecute
ksaiy 2004-11-28
  • 打赏
  • 举报
回复
uses ShellApi;

.....
procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);
begin
Label1.Font.Color:=clred;
Label1.Cursor:=crHandPoint;
end;

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);
begin
Label1.Font.Color:=clWindowText;
end;

procedure TForm1.Label1Click(Sender: TObject);
begin
ShellExecute(Handle,nil,'http://www.ksaiy.com',nil,nil,SW_SHOWNORMAL);
end;
.....
VeryOldMan 2004-11-27
  • 打赏
  • 举报
回复
在label的onclick事件里写代码。

shellexecute('open','your URL',...)

当然在label的onmousemove事件里也写代码,将鼠标形状改为一只手。
yjs_lh 2004-11-27
  • 打赏
  • 举报
回复
在onclick事件中写
use shellapi;

...

shellexecute('iexplorer','open','http://www.sina.com');

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧