# Function Reference

# _GUICtrlSlider_SetPos

Sets the current logical position of the slider

#include <GuiSlider.au3>
_GUICtrlSlider_SetPos ( $hWnd, $iPosition )

## Parameters

$hWnd | Control ID/Handle to the control
$iPosition | New logical position of the slider

## Return Value

None.

## Related

_GUICtrlSlider_GetPos

## Example

    #include <GUIConstantsEx.au3>
    #include <GuiSlider.au3>
    #include <MsgBoxConstants.au3>

    Example()

    Func Example()
        ; Create GUI
        GUICreate("Slider Get/Set Pos (v" & @AutoItVersion & ")", 400, 296)
        Local $idSlider = GUICtrlCreateSlider(2, 2, 396, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_ENABLESELRANGE))
        GUISetState(@SW_SHOW)

        ; Set Pos
        _GUICtrlSlider_SetPos($idSlider, Random(0, 100, 1))

        ; Get Pos
        MsgBox($MB_SYSTEMMODAL, "Information", "Pos: " & _GUICtrlSlider_GetPos($idSlider))

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUIDelete()
    EndFunc   ;==>Example