Function Reference


_GUICtrlSlider_SetRangeMax

Sets the maximum logical position for the slider

#include <GuiSlider.au3>
_GUICtrlSlider_SetRangeMax ( $hWnd, $iMaximum )

Parameters

$hWnd Control ID/Handle to the control
$iMaximum Maximum position for the slider

Return Value

None.

Remarks

If the current slider position is greater than the new maximum, the _GUICtrlSlider_SetRangeMax() function sets the slider position to the new maximum value.

Related

_GUICtrlSlider_GetRangeMax, _GUICtrlSlider_SetRange, _GUICtrlSlider_SetRangeMin

Example

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

Example()

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

        ; Get Range Max
        MsgBox($MB_SYSTEMMODAL, "Information", "Range Max: " & _GUICtrlSlider_GetRangeMax($idSlider))

        ; Set Range Max
        _GUICtrlSlider_SetRangeMax($idSlider, 50)

        ; Get Range Max
        MsgBox($MB_SYSTEMMODAL, "Information", "Range Max: " & _GUICtrlSlider_GetRangeMax($idSlider))

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