好几年都不用VB了,今天要改一个VB的程序
需要让标签可以变成像网页的超链接
这个怎么做?

解决方案 »

  1.   

    打开连接:
    Private Sub Label1_Click()
        Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE http:\\www.hao123.com", vbNormalFocus
    End Sub
      

  2.   

    Option Explicit
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPrivate Sub Form_Load()
        With Me.Label1
            .Caption = "Hello World"
            .ForeColor = vbBlue
            .FontUnderline = True
            .AutoSize = True
        End With
    End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Me.MousePointer = 0
    End SubPrivate Sub Label1_Click()
        Dim strUrl As String    strUrl = "www.csdn.net"
        ShellExecute hwnd, "Open", strUrl, "", "", 1
    End SubPrivate Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Me.MousePointer = 9
    End Sub我这里只是把鼠标变成箭头,如果你要变成手,你就要找一张手形的ico代替
      

  3.   

    第一种,不错
    第二种,找不到shell32.dll
    不过还是谢谢两位了