用API函数:好象是shellexec(...)这个函数,在delphi中查一下帮助就行了

解决方案 »

  1.   

    procedure TForm1.N4Click(Sender: TObject);
    begin
       ShellExecute(0,'open','http://www.sohu.com,nil,nil,sw_normal);
    end;
      

  2.   

    to cultra(协作者):程序调不过去,是否得引用单元 ?
      

  3.   

    ShellExecute(0,nil,'http://www.sohu.com',nil,nil,sw_normal);
      

  4.   

    uses ShellAPI
    ShellExecute(Handle,'open',PChar(Label19.Caption),nil,nil,SW_SHOWNORMAL);
      

  5.   

    //pas
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, ExtCtrls, StdCtrls;type
      TForm1 = class(TForm)
        Label1: TLabel;
        Label2: TLabel;
        procedure Label2MouseEnter(Sender: TObject);
        procedure Label2MouseLeave(Sender: TObject);
        procedure Label1MouseDown(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}uses
      ShellApi;procedure TForm1.Label2MouseEnter(Sender: TObject);
    begin
      TLabel(Sender).Font.Color := clBlue;
      TLabel(Sender).Font.Style := [fsUnderline];
    end;procedure TForm1.Label2MouseLeave(Sender: TObject);
    begin
      TLabel(Sender).Font.Color := clWindowText;
      TLabel(Sender).Font.Style := [];
    end;procedure TForm1.Label1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
      ShellExecute(0, 'OPEN', PChar(TLabel(Sender).Caption), nil, nil, SW_NORMAL);
    end;end.//dfm
    object Form1: TForm1
      Left = 192
      Top = 107
      Width = 544
      Height = 375
      Caption = 'Form1'
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      OldCreateOrder = False
      PixelsPerInch = 96
      TextHeight = 13
      object Label1: TLabel
        Left = 8
        Top = 48
        Width = 99
        Height = 13
        Caption = 'http://www.csdn.net'
        OnMouseDown = Label1MouseDown
        OnMouseEnter = Label2MouseEnter
        OnMouseLeave = Label2MouseLeave
      end
      object Label2: TLabel
        Left = 8
        Top = 104
        Width = 104
        Height = 13
        Caption = 'http://www.sohu.com'
        OnMouseDown = Label1MouseDown
        OnMouseEnter = Label2MouseEnter
        OnMouseLeave = Label2MouseLeave
      end
    end
      

  6.   

      object Label1: TLabel
        //....
        Cursor = crHandPoint
        //....
      end
      object Label2: TLabel
        //....
        Cursor = crHandPoint
        //....
      end
      

  7.   

      ShellExecute(Handle, 'OPEN', PChar(TLabel(Sender).Caption), nil, nil, SW_NORMAL);
    //             ~~~~~~
      

  8.   

    抱歉,忘了。interfaceuses ShellAPI;
      

  9.   

    ShellExecute(0,'open','http://www.sohu.com',nil,nil,sw_normal);记住在Uses 后加上ShellAPI