Determine if a control's scrollbars are visible
Use this function to determine if the scrollbars on a control are visible.
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
Private Function IsScrollBarVisible(ControlHwnd As Long) As Boolean
Dim blnResult As Boolean
Dim wndStyle As Long
'Retrieve the window style of the control.
wndStyle = GetWindowLong(ControlHwnd, GWL_STYLE)
'Test if the vertical scroll bar style is present
'in the window style, indicating that a vertical
'scroll bar is visible.
If (wndStyle And WS_VSCROLL) <> 0 Then
blnResult = True
End If
' Test if the horizontal scroll bar style is present
' in the window style, indicating that a horizontal
' scroll bar is visible.
If (wndStyle And WS_HSCROLL) <> 0 Then
blnResult = True
End If
IsScrollBarVisible = blnResult
End Function
Original Comments (3)
Recovered from Wayback Machine