ZjiÜt∞nφ viditelnosti Scrollbar∙

Postup:
Deklarujte:

Private Declare Function GetWindowLong Lib "user32" Alias _
    "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex _
    As Long) As Long

Private Const GWL_STYLE = (-16)
Private Const WS_HSCROLL = &H100000
Private Const WS_VSCROLL = &H200000

Enum Enum_VisibleScrollBars
    vs_none = 0
    vs_vertical = 1
    vs_horizontal = 2
    vs_both = 4
End Enum

Public Function VisibleScrollBars(ControlName As Control) _
    As Enum_VisibleScrollBars

    Dim MyStyle As Long

    MyStyle = GetWindowLong(ControlName.hWnd, GWL_STYLE)

    If (MyStyle And (WS_VSCROLL Or WS_HSCROLL)) = _
        (WS_VSCROLL Or WS_HSCROLL) Then
        Let VisibleScrollBars = vs_both
    ElseIf (MyStyle And WS_VSCROLL) = WS_VSCROLL Then
        Let VisibleScrollBars = vs_vertical
    ElseIf (MyStyle And WS_HSCROLL) = WS_HSCROLL Then
        Let VisibleScrollBars = vs_horizontal
    Else
        Let VisibleScrollBars = vs_none
    End If

End Function

Zp∞t

Autor: The Bozena