- Option Explicit
- Dim i As Integer
-
- Private Sub Form_Load()
-
- For i = 0 To Label1.Count - 1
- Label1(i).ToolTipText = "Visiter " & Label1(i).Caption
- Next
- ' Met a jour l'info bulle pour chaque lien
- End Sub
-
- Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
- For i = 0 To Label1.Count - 1
- Label1(i).FontUnderline = False ' Lorsque la souris passe au dessus de la
- Next ' Form les liens ne sont plus soulignés
-
- End Sub
-
- Private Sub Label1_Click(Index As Integer)
-
- With Label1(Index)
- .FontUnderline = False ' Enleve le trait de soulignement lors du click
- .ForeColor = vbRed ' Pour marqué en rouge les liens deja visités
- End With
-
- ' ### Action associé au click du lien
- ' ### Si la propriété Tag est vide on lance le lien par la propriété Caption
- ' ### Sinon on lance le lien avec la propriété Tag
-
- If Label1(Index).Tag = "" Then
- Shell "explorer " & Label1(Index).Caption, vbHide ' Lance Le lien avec la propriété Caption
- Else
- Shell "explorer " & Label1(Index).Tag, vbHide ' Lance Le lien avec la propriété Tag
- End If
-
- End Sub
-
- Private Sub Label1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
-
- For i = 0 To Label1.Count - 1 ' Boucle pour la totalité des controles
- If i = Index Then ' Si la souris est sur ce controle
- Label1(i).FontUnderline = True ' on le souligne
- Else
- Label1(i).FontUnderline = False ' ou on le "désouligne"
- End If
- Next
-
- End Sub
-
- Private Sub Label1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
-
- For i = 0 To Label1.Count - 1
- Label1(i).FontUnderline = False ' Lorsque le clik de la souris est relaché
- Next ' Les liens son désoulignés
-
- End Sub
Option Explicit
Dim i As Integer
Private Sub Form_Load()
For i = 0 To Label1.Count - 1
Label1(i).ToolTipText = "Visiter " & Label1(i).Caption
Next
' Met a jour l'info bulle pour chaque lien
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
For i = 0 To Label1.Count - 1
Label1(i).FontUnderline = False ' Lorsque la souris passe au dessus de la
Next ' Form les liens ne sont plus soulignés
End Sub
Private Sub Label1_Click(Index As Integer)
With Label1(Index)
.FontUnderline = False ' Enleve le trait de soulignement lors du click
.ForeColor = vbRed ' Pour marqué en rouge les liens deja visités
End With
' ### Action associé au click du lien
' ### Si la propriété Tag est vide on lance le lien par la propriété Caption
' ### Sinon on lance le lien avec la propriété Tag
If Label1(Index).Tag = "" Then
Shell "explorer " & Label1(Index).Caption, vbHide ' Lance Le lien avec la propriété Caption
Else
Shell "explorer " & Label1(Index).Tag, vbHide ' Lance Le lien avec la propriété Tag
End If
End Sub
Private Sub Label1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
For i = 0 To Label1.Count - 1 ' Boucle pour la totalité des controles
If i = Index Then ' Si la souris est sur ce controle
Label1(i).FontUnderline = True ' on le souligne
Else
Label1(i).FontUnderline = False ' ou on le "désouligne"
End If
Next
End Sub
Private Sub Label1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
For i = 0 To Label1.Count - 1
Label1(i).FontUnderline = False ' Lorsque le clik de la souris est relaché
Next ' Les liens son désoulignés
End Sub