Function Reference


_GUIScrollBars_EnableScrollBar

Enable/Disable scrollbar

#include <GuiScrollBars.au3>
_GUIScrollBars_EnableScrollBar ( $hWnd [, $iSBflags = $SB_BOTH [, $iArrows = $ESB_ENABLE_BOTH]] )

Parameters

$hWnd Handle to the window
$iSBflags [optional] Specifies the scroll bar type. This parameter can be one of the following values:
    $SB_BOTH - Enables or disables the arrows on the horizontal and vertical scroll bars associated with the specified window.
    $SB_CTL - Indicates that the scroll bar is a scroll bar control. The $hWnd must be the handle to the scroll bar control.
    $SB_HORZ - Enables or disables the arrows on the horizontal scroll bar associated with the specified window.
    $SB_VERT - Enables or disables the arrows on the vertical scroll bar associated with the specified window.
$iArrows [optional] Specifies whether the scroll bar arrows are enabled or disabled and indicates which arrows are enabled or disabled.
This parameter can be one of the following values
    $ESB_DISABLE_BOTH - Disables both arrows on a scroll bar.
    $ESB_DISABLE_DOWN - Disables the down arrow on a vertical scroll bar.
    $ESB_DISABLE_LEFT - Disables the left arrow on a horizontal scroll bar.
    $ESB_DISABLE_LTUP - Disables the left arrow on a horizontal scroll bar or the up arrow of a vertical scroll bar.
    $ESB_DISABLE_RIGHT - Disables the right arrow on a horizontal scroll bar.
    $ESB_DISABLE_RTDN - Disables the right arrow on a horizontal scroll bar or the down arrow of a vertical scroll bar.
    $ESB_DISABLE_UP - Disables the up arrow on a vertical scroll bar.
    $ESB_ENABLE_BOTH - Enables both arrows on a scroll bar.

Return Value

Success: True.
Failure: False.

Related

_GUIScrollBars_ShowScrollBar

See Also

Search EnableScrollBar in MSDN Library.

Example

#include <GUIConstantsEx.au3>
#include <GuiScrollBars.au3>
#include <WindowsConstants.au3>

Global $g_idMemo

Example()

Func Example()
    Local $hGUIMsg, $hGUI

    $hGUI = GUICreate("ScrollBar Example", 400, 400, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX))
    $g_idMemo = GUICtrlCreateEdit("", 2, 32, 380, 226, BitOR($WS_HSCROLL, $WS_VSCROLL))
    GUICtrlSetResizing($g_idMemo, $GUI_DOCKALL)
    GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
    GUISetBkColor(0x88AABB)

    GUISetState(@SW_SHOW)

    _GUIScrollBars_Init($hGUI)

    MemoWrite("Disable down arrow: " & _GUIScrollBars_EnableScrollBar($hGUI, $SB_VERT, $ESB_DISABLE_DOWN))
    Sleep(3000)
    MemoWrite("Disable up arrow: " & _GUIScrollBars_EnableScrollBar($hGUI, $SB_VERT, $ESB_DISABLE_UP))
    Sleep(3000)
    MemoWrite("Enable both arrows: " & _GUIScrollBars_EnableScrollBar($hGUI, $SB_VERT, $ESB_ENABLE_BOTH))
    Sleep(3000)
    MemoWrite("Disable left arrow: " & _GUIScrollBars_EnableScrollBar($hGUI, $SB_HORZ, $ESB_DISABLE_LEFT))
    Sleep(3000)
    MemoWrite("Disable right arrow: " & _GUIScrollBars_EnableScrollBar($hGUI, $SB_HORZ, $ESB_DISABLE_RIGHT))
    Sleep(3000)
    MemoWrite("Enable both arrows: " & _GUIScrollBars_EnableScrollBar($hGUI, $SB_HORZ, $ESB_ENABLE_BOTH))

    While 1
        $hGUIMsg = GUIGetMsg()

        Switch $hGUIMsg
            Case $GUI_EVENT_CLOSE;, $nExititem
                ExitLoop
        EndSwitch
    WEnd

    Exit
EndFunc   ;==>Example

; Write a line to the memo control
Func MemoWrite($sMessage)
    GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite