ScrollBar_Add( HParent, X, Y, W = "", H = "", Handler = "", o1 = "", o2 = "", o3 = "", o4 = "", o5 = "" )
Creates scroll bar control.
| HParent | Handle of the parent window. |
| X..H | Position. You can omit width and height to use system’s default for vertical or horizontal scroll bar. To glue scroll bar to another GUI control, specify control’s handle as X parameter and omit Y parameter. In glue mode, y parameter is ignored; w is ignored for horizontal, and h for vertical scroll bar. |
| Handler | Handler routine. See below. |
| o1..o5 | Optional parameters. |
| style | ”hor” (defualt) or “ver”. |
| min, max | range, by default 0, 100. |
| pos | initial position of the slider, by deafult 0. |
| page | page, by default 10. |
Handler(HCtrl, Pos)
| HCtrl | Handle of the control sending notification. |
| Pos | Position of the slider. |
Handle of the control, error message if control can not be created.
hHBar := ScrollBar_Add(hwnd, 0, 0, 280, -1, “OnScroll”, “style=ver”, “min=1”, “max=100”, “page=10”, “pos=10”) ScrollBar_Add(hwnd, “myEdit”, 0, 0, 0, “OnScroll”) ;glue to the myEdit GUI control
ScrollBar_Get( HCtrl, pQ = "", ByRef o1 = "", ByRef o2 = "", ByRef o3 = "", ByRef o4 = "", ByRef o5 = "" )
Get the scrollbar parameter.
| HCtrl | Handle of the scroll bar control. |
| pQ | Query parameter. Any space separated combination of pos, page, min, max, track. Omit to return all data in that order. |
| o1..o5 | Reference to oputut variables. |
o1 on success, nothing on failure.
ScrollBar_Set( HCtrl, Pos = "", Min = "", Max = "", Page = "", Redraw = "" )
Set scroll bar parameters.
| HCtrl | Handle of the scroll bar control. |
| Pos | Set position, by default 0. |
| Page | Set page, optional. |
| Min | Set minimum, optional. |
| Max | Set maximum, optional. |
| Redraw | Set to true to redraw the scroll bar. |
Current position of the scroll bar.
Gui, +LastFound
hGui := WinExist()
Gui, Add, Edit, -vscroll y50 h100 w230 vMyEdit, 0
hHBar := ScrollBar_Add(hGui, 0, 10, 280, 8, "OnScroll", "min=0", "max=50", "page=5")
hVBar := ScrollBar_Add(hGui, 280, 10, -1, 290, "OnScroll", "style=ver", "pos=10")
;glue to the MyEdit
hhE := ScrollBar_Add(hGui, "myEdit", 0, 0, 10, "OnScroll", "pos=50")
hvE := ScrollBar_Add(hGui, "myEdit", 0, 0, 0, "OnScroll", "style=ver", "pos=50")
Gui, show, h300 w300, ScrollBar Test
return
OnScroll:
if (ScrollBar_HWND = hHBar)
s := "horizontal"
else if (ScrollBar_HWND = hVBar)
s := "vertical"
else s := "glued"
ControlSetText, Edit1, %ScrollBar_POS% - %s% bar
returnCreates scroll bar control.
ScrollBar_Add( HParent, X, Y, W = "", H = "", Handler = "", o1 = "", o2 = "", o3 = "", o4 = "", o5 = "" )
Get the scrollbar parameter.
ScrollBar_Get( HCtrl, pQ = "", ByRef o1 = "", ByRef o2 = "", ByRef o3 = "", ByRef o4 = "", ByRef o5 = "" )
Set scroll bar parameters.
ScrollBar_Set( HCtrl, Pos = "", Min = "", Max = "", Page = "", Redraw = "" )
Set scroll bar position and redraws it.
ScrollBar_SetPos( HCtrl, Pos = 1 )
Enable or disable scroll bar.
ScrollBar_Enable( HCtrl, Enable = true )
Show or hide scroll bar.
ScrollBar_Show( HCtrl, Show = true )