Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    [vb6] Linkare un testo a un sito

    come posso fare a lincare www.miosito.it in un label in modo che mi apra quel sito col browser predefinito?

  2. #2
    Utente di HTML.it L'avatar di junx
    Registrato dal
    May 2004
    Messaggi
    322
    codice:
    Public Enum OpType
        Startup = 1
        Click = 2
        FormMove = 3
        LinkMove = 4
    End Enum
    Dim Clicked As Boolean
    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 Long
    Private Sub Form_Load()
        MakeLink Label1, Startup
    End Sub
    
    Private Sub Form_MouseMove(Button As Integer, _
            Shift As Integer, X As Single, Y As Single)
        MakeLink Label1, FormMove
    End Sub
    
    Private Sub Label1_Click()
        MakeLink Label1, Click, Me
    End Sub
    
    Private Sub Label1_MouseMove(Button As Integer, _
            Shift As Integer, X As Single, Y As Single)
        MakeLink Label1, LinkMove
    End Sub
    
    Public Sub MakeLink(LabelName As Label, _
            Operation As OpType, Optional FormName As Form)
        Dim Openpage As Integer
        Select Case Operation
            Case LinkMove
                LabelName.ForeColor = 255
                LabelName.FontUnderline = True
            Case Click
                Openpage = ShellExecute(FormName.hwnd, _
                    "Open", LabelName.Caption, "", App.Path, 1)
                LabelName.ForeColor = 8388736
                Clicked = True
            Case FormMove
                LabelName.FontUnderline = False
                If Not Clicked Then
                    LabelName.ForeColor = 16711680
                Else
                    LabelName.ForeColor = 8388736
                End If
            Case Startup
                LabelName.ForeColor = 16711680
        End Select
    End Sub
    Ciao.

  3. #3
    azz... :metallica


    e dove la metto tutta stà robba???

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.