如题

解决方案 »

  1.   

    uses shellapi;
    shellexecute(handle,nil,'www.csdn.net',nil,nil,sw_shownormal);
    发问前可以搜索一下,这类问题很多。shellexecute这个函数用处很多,看一下帮助文档吧。
      

  2.   

    抱歉,刚才把函数记错了 这是有一篇别人的贴子 你看一下吧。
     
    主  题:  如何在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);
     
     
     
      

  3.   

    这个基本上不能有超链接的概念来实现
    其实,你可以这么做,
    你的意思是比如说我点一下“打开网络蚂蚁”这个lable
    那么就可以在lable的click
    用winexec来执行外部程序,或者是windows的自带函数
      

  4.   

    LabelClick:
    winexec('C:\PROGRA~1\INTERN~1\iexplore.exe www.csdn.net');
      

  5.   

    winexec已经过时了,现在不用了