'**********************************************************************************
' __ _____ ___ . ___ _____ ___ ___
'|__| /\ | | | | | | / | | | | | | | | |\ |
'| /__\ | |--- | | |/\ | | | | | | | | | \ |
'| / \ | | \ | |___ | \ | |___| |___| |__ |___| | \|
'***********************************************************************************
'userform exemple d'utilisation du module de hooking de la souris pour le Scroll avec la mollette(simplifié)
'version 4.0
'Date version :octobre 2022
'Auteur: patricktoulon sur exceldownloads
Option Explicit
Private Sub UserForm_Initialize()
Dim I&, a&
For I = 1 To 100
ComboBox1.AddItem I
For a = 3 To 6
Me.Frame2.Controls("ComboBox" & a).AddItem I * 100
Next
qliste.AddItem I * 45
Next
End Sub
Private Sub ComboBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
HookMouse ComboBox1
End Sub
Private Sub ComboBox2_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
HookMouse ComboBox2
End Sub
Private Sub ComboBox3_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
HookMouse ComboBox3
End Sub
Private Sub ComboBox4_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
HookMouse ComboBox4
End Sub
Private Sub ComboBox5_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
HookMouse ComboBox5
End Sub
Private Sub ComboBox6_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
HookMouse ComboBox6
End Sub
Private Sub qliste_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
HookMouse qliste
End Sub
Private Sub Frame1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
HookMouse Frame1
End Sub
'a cas ou il y aurait eu un bug quelque part et que le houk ne se serait pas arrêté
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
UnHookMouse
End Sub