Escolar Documentos
Profissional Documentos
Cultura Documentos
Getting and setting scroll bar value, max, min and large-
change properties is achieved via the GetScrollInfo and
SetScrollInfo properties, which work on the
SCROLLINFO structure:
' Scroll bar:
Private Type SCROLLINFO
cbSize As Long ' Size of structure
fMask As Long ' Which value(s) you are
changing
nMin As Long ' Minimum value of the
scroll bar
nMax As Long ' Maximum value of the
scroll bar
nPage As Long ' Large-change amount
nPos As Long ' Current value
nTrackPos As Long ' Current scroll position
End Type
Note that the actual Max value of the scroll bar is actually
equal to the nMax value plus the nPage value, so when
modifying the LargeChange or Max value you have to
take this into account.
This allows you to set up the scroll bars. You then need to
respond to the scroll bar position changing. This is done
by intercepting the WM_HSCROLL and
WM_VSCROLL messages sent to the window you have
added scroll bars to:
' Scroll bar messages:
Private Const WM_VSCROLL = &H115
Private Const WM_HSCROLL = &H114