我想在关于窗体中加入一行网址,作为链接,当用户点击它时,就可以启动IE进入到该网站,请问如何作。最好给出示范代码。

解决方案 »

  1.   

    加一个普通的Label,将他的样式设定为蓝色,鼠标到那时,变成手形,这个你应该会把;
    然后,在他的click时间中写
    ShellExecute(handle,nil,pchar('http://www.sina.com.cn'),nil,nil,sw_shownormal);
      

  2.   

    uses shellapi;procedure TForm1.Label4Click(Sender: TObject);
    begin
    Shellexecute(handle,nil,pchar('http://www.163.com'),nil,nil,sw_shownormal);
    end;
      

  3.   

    uses 中加入 ShellAPI
    procedure TForm1.Label1Click(Sender: TObject);
    begin
        ShellExecute(Handle,'open','http://www.csdn.net.net','','',SW_SHOW)end;
      

  4.   

    把lable的caption属性输入你的网址.在onclick事件中输入
    ShellExecute(Application.Handle, nil, PChar(TLabel(Sender).Caption), nil, nil, SW_SHOWNORMAL);
      

  5.   

    再加上这个效果就更好了
    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;
      

  6.   

    //超级连接效果
    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);
      

  7.   

    ShellExecute(handle,nil,pchar('www.163.com'),nil,nil,sw_shownormal);
      

  8.   

    再把CurSor:=crHandPoint
    -------------------------------
    Microsoft OLE DB Provider for SQL Server 错误 '80040e31' 超时已过期 /Expert/reply.asp,行105