Added Mouse Wheel support. Thanks to Chris Eastwood at vbCode Library for the suggestion. The SB_BOTTOM and SB_TOP scroll codes were swapped. The scroll bar now goes to the correct position when you choose Top or Bottom from the Scroll Bar's context menu. Added ScrollClick event which is raised when a mouse down occurs on the scroll bar.
| vbAccelerator - Contents of code file: mMain.basAttribute VB_Name = "mMain"
Option Explicit
Private Type tagInitCommonControlsEx
lngSize As Long
lngICC As Long
End Type
Private Declare Function InitCommonControlsEx Lib "comctl32.dll" (iccex As
tagInitCommonControlsEx) As Boolean
Private Const ICC_USEREX_CLASSES = &H200
Public Sub Main()
' we need to call InitCommonControls before we
' can use XP visual styles. Here I'm using
' InitCommonControlsEx, which is the extended
' version provided in v4.72 upwards (you need
' v6.00 or higher to get XP styles)
On Error Resume Next
' this will fail if Comctl not available
' - unlikely now though!
Dim iccex As tagInitCommonControlsEx
With iccex
.lngSize = LenB(iccex)
.lngICC = ICC_USEREX_CLASSES
End With
InitCommonControlsEx iccex
' now start the application
On Error GoTo 0
frmScrollDemo.Show
End Sub
| |
|
|
||