1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| Option Explicit
'utilisation de la classe proposé par hpfx qui ce trouve ici
'http://www.developpez.net/forums/d608943/autres-langages/general-visual-basic-6-vbscript/vb-6-anterieur/vos-contributions-vb6/source-classe-prete-lemploi-tooltiptext-info-bulles/
Dim Bulle() As CtoolTip
Private Sub Form_Load()
ReDim Bulle(2)
'chargement de la classe CtoolTip
Set Bulle(0) = New CtoolTip
Bulle(0).BackColor = &HC0FFFF
Set Bulle(1) = New CtoolTip
Bulle(1).BackColor = &HC0FFC0
Bulle(1).ForeColor = &HC00000
Bulle(1).Centered = True
Bulle(1).Style = TTStandard
Bulle(1).DelayTime = 500
Bulle(1).VisibleTime = 2000
Bulle(1).Icon = TTIconWarning
Bulle(1).TipText = "pour essayer la commande " & vbCrLf _
& "il faut clicker sur le bouton " & Chr(34) & "Command2" & Chr(34) & vbCrLf _
& "SALUT"
Bulle(1).Title = "Démo"
Set Bulle(2) = New CtoolTip
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call Bulle(0).Display(Command1.hwnd, "Une bulle", "il sagit du bouton Command1", TTIconInfo)
End Sub
Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call Bulle(1).Display(Command2.hwnd, "Une bulle", "il sagit du bouton Command2", TTIconInfo)
End Sub
Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call Bulle(2).Display(Text1.hwnd)
End Sub |
Partager