1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Option Explicit
Dim BackSelect As Long
Dim ForColorSelect As Long
Private Sub Form_Load()
BackSelect = &H8000000D
ForColorSelect = &HFFFFFF
End Sub
Private Sub Command1_Click()
'bouton bascule sélectionné/desélectionné
If Label1.BackColor = BackSelect Then
Label1.BackColor = &H80000005: Label1.ForeColor = &H80000008: Label1.ToolTipText = ""
Else
Label1.BackColor = BackSelect: Label1.ForeColor = ForColorSelect
End If
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Label1.ToolTipText = "" And Label1.ForeColor = ForColorSelect Then
'puisque Label1 est en sur-brillance, affiche un texte dans la bulle de celui-ci
Label1.ToolTipText = "Passage du curseur au dessus du label"
End If
End Sub |
Partager