#include <GUIConstantsEx.au3>
#include <GuiScrollBars.au3>
#include <WindowsConstants.au3>
Local $hGUI = GUICreate("ScrollBar Example", 400, 400)
Local $id_button = GUICtrlCreateButton("test", 250, 250, 50,25)
GUISetState(@SW_SHOW)
_GUIScrollBars_Init($hGUI)
_GUIScrollBars_EnableScrollBar($hGUI, $SB_VERT, $ESB_ENABLE_BOTH)
_GUIScrollBars_EnableScrollBar($hGUI, $SB_HORZ, $ESB_ENABLE_BOTH)
_GUIScrollBars_SetScrollInfoPos ($hGUI, $SB_VERT,_GUIScrollBars_GetScrollInfoMax($hGUI, $SB_VERT))
_GUIScrollBars_SetScrollInfoPos ($hGUI, $SB_HORZ,_GUIScrollBars_GetScrollInfoMax($hGUI, $SB_HORZ))
While 1
$hGUIMsg = GUIGetMsg()
Switch $hGUIMsg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $id_button
Local $scrollbarVertPos
Local $scrollbarHorzPos
if $scrollbarVertPos = 0 then _GUIScrollBars_SetScrollInfoPos ($hGUI, $SB_VERT,_GUIScrollBars_GetScrollInfoMax($hGUI, $SB_VERT))
if $scrollbarHorzPos = 0 then _GUIScrollBars_SetScrollInfoPos ($hGUI, $SB_HORZ,_GUIScrollBars_GetScrollInfoMax($hGUI, $SB_HORZ))
$scrollbarVertPos = _GUIScrollBars_GetScrollPos ($hGUI, $SB_VERT )
$scrollbarVertPos = $scrollbarVertPos - 1
$scrollbarHorzPos = _GUIScrollBars_GetScrollPos ($hGUI, $SB_HORZ )
$scrollbarHorzPos = $scrollbarHorzPos - 1
_GUIScrollBars_SetScrollInfoPos ($hGUI, $SB_VERT,$scrollbarVertPos )
_GUIScrollBars_SetScrollInfoPos ($hGUI, $SB_HORZ,$scrollbarHorzPos)
EndSwitch
WEnd
|