Мож вопрос и ламерский, но тот, что у меня в стандартном комплекте ОСХов на колесико не реагирует
Заранее СПАСИБО!
Option Explicit
Private Const PM_REMOVE = &H1
Private Const WM_MOUSEWHEEL = 522
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type Msg
hWnd As Long
Message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As Msg, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long
Private Declare Function WaitMessage Lib "user32" () As Long
Private bCancel As Boolean
Private Sub ProcessMessages()
Dim Message As Msg
Do While Not bCancel
WaitMessage
If PeekMessage(Message, Me.hWnd, WM_MOUSEWHEEL, WM_MOUSEWHEEL, PM_REMOVE) Then
On Error Resume Next
If Message.wParam < 0 Then
VScroll1.Value = VScroll1.Value + 500 'скролл вверх
Else
VScroll1.Value = VScroll1.Value - 500 'скролл вниз
End If
End If
DoEvents
Loop
End Sub
Private Sub Form_Load()
Me.Show
ProcessMessages
End Sub
Private Sub Form_Unload(Cancel As Integer)
bCancel = True
End Sub
Option Explicit
Private Const PM_REMOVE = &H1
Private Const WM_MOUSEWHEEL = 522
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type Msg
hwnd As Long
Message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As Msg, ByVal hwnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long
Private Declare Function WaitMessage Lib "user32" () As Long
Private Declare Function HideCaret Lib "user32" (ByVal hwnd As Long) As Long
Private bCancel As Boolean
Private Sub ProcessMessages()
Dim Message As Msg
Do While Not bCancel
WaitMessage
If PeekMessage(Message, Me.hwnd, WM_MOUSEWHEEL, WM_MOUSEWHEEL, PM_REMOVE) Then
If Message.wParam < 0 Then
If VScroll1.Value + 500 > VScroll1.Max Then VScroll1.Value = VScroll1.Max Else VScroll1.Value = VScroll1.Value + 500 'скролл вверх
Else
If VScroll1.Value - 500 < VScroll1.Min Then VScroll1.Value = VScroll1.Min Else VScroll1.Value = VScroll1.Value - 500 'скролл вниз
End If
End If
DoEvents
Loop
End Sub
Private Sub Form_Load()
Me.Show
ProcessMessages
End Sub
Private Sub Form_Unload(Cancel As Integer)
bCancel = True
End Sub
Private Sub VScroll1_Change()
HideCaret VScroll1.hwnd
End Sub
Private Sub VScroll1_GotFocus()
HideCaret VScroll1.hwnd
End Sub
Private Sub VScroll1_LostFocus()
HideCaret VScroll1.hwnd
End Sub
Private Sub VScroll1_Scroll()
HideCaret VScroll1.hwnd
End Sub
Сейчас этот форум просматривают: Google-бот, Yandex-бот и гости: 155