Creates a Slider control for the GUI.
GUICtrlCreateSlider ( left, top [, width [, height [, style [, exStyle]]]] )
Parameters
| left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode. |
| top | The top of the control. If -1 is used then top will be computed according to GUICoordMode. |
| width | [optional] The width of the control (default is the previously used width). |
| height | [optional] The height of the control (default is the previously used height). |
| style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : $TBS_AUTOTICKS |
| exStyle | [optional] Defines the extended style of the control. See Extended Style Table. |
Return Value
| Success: | Returns the identifier (controlID) of the new control. |
| Failure: | Returns 0. |
Remarks
To obtain the value of the control see GUICtrlRead.
Related
GUICoordMode (Option), GUICtrlSetData, GUICtrlSetLimit, GUICtrlUpdate..., GUIGetMsg
Example
#include <GUIConstantsEx.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $slider1, $button, $msg
GUICreate("slider", 220, 100, 100, 200)
GUISetBkColor(0x00E0FFFF) ; will change background color
$slider1 = GUICtrlCreateSlider(10, 10, 200, 20)
GUICtrlSetLimit(-1, 200, 0) ; change min/max value
$button = GUICtrlCreateButton("Value?", 75, 70, 70, 20)
GUISetState()
GUICtrlSetData($slider1, 45) ; set cursor
Do
$msg = GUIGetMsg()
If $msg = $button Then
MsgBox(0, "slider1", GUICtrlRead($slider1), 2)
EndIf
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example