如题
解决方案 »
- 请教delphi开发的软件为什么只有一个exe
- 菜鸟问题,数据类型错误求助
- select ACCESS数据库变动计算方法得结果
- 再问: 求如何得到系统上网卡MAC地址的源码。。如何从注册表中求得网卡MAC地址????sorry...全分奉送了。。
- 关于showmodal.result问题,解结就给分
- 用DELPHI如何把图片存在EXCEL文件中?
- ListView中添加了几个QQ那样的图标,如何实现像QQ那样消息来了自动闪烁头像的功能?
- 我下载的d5adoupgrade和d5adoupdate2在安装时老是报错。请问那位高手不令赐教。
- 如何利用消息机制,将一个应用程序处理的结果(40字节的数据),post给另一应用程序?
- 我是菜鸟,问一个关于类的问题
- 怎样重新产生一个消息?
- sos~
shellexecute(handle,nil,'www.csdn.net',nil,nil,sw_shownormal);
发问前可以搜索一下,这类问题很多。shellexecute这个函数用处很多,看一下帮助文档吧。
主 题: 如何在delphi中加超链接?
作 者: hfkobe (沙哈拉)
等 级:
信 誉 值: 100
所属论坛: Delphi 基础类
问题点数: 20
回复次数: 9
发表时间: 2002-7-15 20:53:49
如何在delphi中加超链接,使它能打开浏览器,浏览网页?
回复人: delphi0302(好好学习,天天向上!) ( ) 信誉:100 2002-7-15 20:57:20 得分:0
可以在onclick事件中打开一个浏览器呀
那个函数是什么我忘了
你查一下,挺好找的
Top
回复人: qiqi97(我是菜鸟我怕谁) ( ) 信誉:100 2002-7-15 21:00:27 得分:0
SellExecute(handle,nil,pchar('http://www.myvc.net'),nil,nil,
sw_shownormal);
Top
回复人: zhuxud(圣东方) ( ) 信誉:100 2002-7-15 21:00:35 得分:0
use shellapi;
shellexecute(0,'open','www.csdn.net',nil,nil,sw_normal);
Top
回复人: lbisme(十万个为什么) ( ) 信誉:100 2002-7-15 21:01:10 得分:0
shellexecute(Application.handle,nil,pchar('http://www.sohu.com'),nil,nil,SW_SHOWNORMAL);
Top
回复人: lbisme(十万个为什么) ( ) 信誉:100 2002-7-15 21:03:49 得分:0
送一个带链功能的label控件unit UrlLabel;interfaceuses
Windows, Classes, Controls, StdCtrls, SysUtils, Forms,
Graphics, ShellAPI;type
TUrlLabel = class(TLabel) private
{ Private declarations }
Url:string;
procedure ExeUrl;
procedure seturl(value:string);
protected
procedure Click;override;
public
{ Public declarations }
constructor Create(AOwner:TComponent);override;
Published
property UrlString:string read Url write seturl;
end;procedure Register;implementationconst
defaulturl:string='http://lb001.51.net';
procedure TUrlLabel.click;
begin
inherited click;
ExeUrl;
end;
constructor TUrlLabel.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
Url:=defaulturl;
Caption:=Url;
font.style:=[fsUnderline];
font.color:=clBlue;
Cursor:=crHandPoint;
end;
procedure TUrlLabel.ExeUrl;
begin
shellexecute(Application.handle,nil,pchar(Url),nil,nil,SW_SHOWNORMAL);
end;
procedure TUrlLabel.seturl(value:string);
begin
Url:=value;
if csDesigning in ComponentState then
begin
Caption := Value;
//Application.MessageBox('Your changed the urlstring!','',mb_ok);
end;
end;procedure Register;
begin
RegisterComponents('mycontrols',[TUrlLabel]);
end;end.
Top
回复人: hfkobe(沙哈拉) ( ) 信誉:100 2002-7-17 13:26:52 得分:0
邮件链接呢?
Top
回复人: Delphist(飞燕草) ( ) 信誉:100 2002-7-17 15:07:26 得分:0
在use 中加shellapi
再在label1的ONCLICK事件中加入
SellExecute(handle,nil,'http://www.whlhbh.8u8.com',nil,nil,
sw_shownormal);
如果想做更像的话可以定义LABEL1的鼠标形状定义成手形,在ONMOUSEMOVE
事件中使LABEL1的字变色。
Top
回复人: jackie168(星星知我心) ( ) 信誉:100 2002-7-17 16:38:41 得分:0
uses ShellAPI;
SellExecute(handle,nil,pchar('http://www.163.com'),nil,nil,
sw_shownormal);
Top
回复人: oracle_lover(数据库情人) ( ) 信誉:115 2002-7-18 1:23:36 得分:0
邮件连接一样
uses ShellApi
shellexecute(handle,nil,pchar('mailto:[email protected]'),nil,nil,sw_shownormal);
其实,你可以这么做,
你的意思是比如说我点一下“打开网络蚂蚁”这个lable
那么就可以在lable的click
用winexec来执行外部程序,或者是windows的自带函数
winexec('C:\PROGRA~1\INTERN~1\iexplore.exe www.csdn.net');