Question : Visual basic: how to use the Mouse wheel on and off (lebans software):

Hi I want to use the module that's described at http://www.lebans.com/mousewheelonoff.htm. It would stop the mouse wheel scrolling through the records on a form.

Unfortuantely I have no clue how to make it work using visual basic. I've pasted what the site recommends. Could someone tell me where to put this code. I think the code is a button that the user can press to turn the mouse wheel off. I would like to set the mouse wheel off for all forms. There may be several users of the database.

Any help would be much appreciated !

Thanks.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
Here is sample code that can be placed behind CommandButton controls. You could also place this code in the Load event of a single Form. Remember you need to call these functions only ONE TIME. The MouseHook will look after the MouseWheel messages for all forms that you have open now or at any time during your current session. Remember to turn the MouseWheel back on before you exit the current session!
 
Private Sub Command14_Click()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF
End Sub
 
Or if you will be running multiple instances of Access then you can pass an optional parameter to ask for a Global Hook. The default is FALSE. Please note the Version documentation below.
 
blRet = MouseWheelOFF(True)
 
 
Private Sub Command16_Click()
' Turn the MouseWheel On
Dim blRet As Boolean
blRet = MouseWheelON
End Sub

Answer : Visual basic: how to use the Mouse wheel on and off (lebans software):

The button in his demo is just for the demo.  Basically, to turn it off for all forms, you call that function maybe form a startup form that you have, or great an AutoExec macro that calls a function which executes that line of code, like so

Public Function MouseWheelCtl ()

Call MouseWheelOFF(True)

End Function

mx
Random Solutions  
 
programming4us programming4us