Comment désacriver la roulette ?

cs_darunia Messages postés 354 Date d'inscription mercredi 18 décembre 2002 Statut Membre Dernière intervention 24 mars 2011 - 25 mars 2003 à 13:38
cs_Biname Messages postés 2 Date d'inscription jeudi 18 mars 2004 Statut Membre Dernière intervention 27 octobre 2004 - 27 oct. 2004 à 14:10
Salut,
Est-ce que quelqu'un sait comment désactiver la roulette dans un formulaire access ?
Ca me fausse tout alors si quelqu'un peut m'aider ...

3 réponses

Neo.balastik Messages postés 796 Date d'inscription jeudi 17 mai 2001 Statut Membre Dernière intervention 5 mai 2009 7
25 mars 2003 à 15:53
Salut,

Une piste...
http://www.mvps.org/access/api/api0036.htm

Tchao

NéoB
0
pelw Messages postés 148 Date d'inscription dimanche 12 janvier 2003 Statut Membre Dernière intervention 14 février 2005 6
25 mars 2003 à 18:14
Voici ce que propose Microsoft :

http://support.microsoft.com/default.aspx?scid=kb;DA;q278379

@+

pelw
0
cs_Biname Messages postés 2 Date d'inscription jeudi 18 mars 2004 Statut Membre Dernière intervention 27 octobre 2004
27 oct. 2004 à 14:10
Bonjour,

Vous pourriez peut-etre essayer ceci.....
Je vous souhaite bonne chance pour votre réalisation

Créez un module standard que vous appelez basSubClassWindow et vous copiez le code ci-dessous:

Option Compare Database
Option Explicit

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
(ByVal lpPrevWndFunc As Long, _
ByVal hwnd As Long, _
ByVal msg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Public Const GWL_WNDPROC = -4
Public Const WM_MouseWheel = &H20A
Public lpPrevWndProc As Long
Public CMouse As CMouseWheel
Public Function WindowProc(ByVal hwnd As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Select Case uMsg
Case WM_MouseWheel
CMouse.FireMouseWheel
If CMouse.MouseWheelCancel = False Then
WindowProc = CallWindowProc(lpPrevWndProc, hwnd, uMsg, wParam, lParam)
End If
Case Else
WindowProc = CallWindowProc(lpPrevWndProc, hwnd, uMsg, wParam, lParam)
End Select
End Function

*************************************************

Créez un module de classe que vous appelez CMouseWheel et vous copiez le code ci-dessous:

Option Compare Database
Option Explicit
Private frm As Access.Form
Private intCancel As Integer
Public Event MouseWheel(Cancel As Integer)
Public Property Set Form(frmIn As Access.Form)
Set frm = frmIn
End Property
Public Property Get MouseWheelCancel() As Integer
MouseWheelCancel = intCancel
End Property
Public Sub SubClassHookForm()
lpPrevWndProc = SetWindowLong(frm.hwnd, GWL_WNDPROC, _
AddressOf WindowProc)
Set CMouse = Me
End Sub
Public Sub SubClassUnHookForm()
Call SetWindowLong(frm.hwnd, GWL_WNDPROC, lpPrevWndProc)
End Sub
Public Sub FireMouseWheel()
RaiseEvent MouseWheel(intCancel)
End Sub

**************************************************

Dans le code de votre formulaire, incluez le code ci-dessous soit par copie soit en insérant les lignes dans les sub déjà présentes:

Option Compare Database
Option Explicit
Private WithEvents clsMouseWheel As CMouseWheel

Private Sub Form_Load()
If Me.DefaultView = 0 Then
Set clsMouseWheel = New CMouseWheel
Set clsMouseWheel.Form = Me
clsMouseWheel.SubClassHookForm
End If
End Sub

Private Sub Form_Close()
If Me.DefaultView = 0 Then
clsMouseWheel.SubClassUnHookForm
Set clsMouseWheel.Form = Nothing
Set clsMouseWheel = Nothing
End If
End Sub

Private Sub clsMouseWheel_MouseWheel(Cancel As Integer)
Cancel = True
End Sub

**************************************************

Attention: N'utilisez pas le formulaire à ce moment-là sinon Access va se bloquer. Quittez VBA, Quittez Access, relancez votre base et exécutez le formulaire.
0
Rejoignez-nous