Advertisement
7_2009-2012 Miscellaneous #230401

Determine if a control's scrollbars are visible

Use this function to determine if the scrollbars on a control are visible.

AI

สรุปโดย AI: 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.

ซอร์สโค้ด
original-source
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
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine