Définit la plage des positions logiques minimale et maximale d'un Slider
#include <GuiSlider.au3>
_GUICtrlSlider_SetRange ( $hWnd, $iMinimum, $iMaximum )
$hWnd | ID/handle du contrôle Slider |
$iMinimum | Position minimale du Slider |
$iMaximum | Position maximale du Slider |
Si la position du curseur actuelle est en dehors de la nouvelle plage, la fonction _GUICtrlSlider_SetRange() définit la position du curseur à la nouvelle valeur maximale ou minimale.
_GUICtrlSlider_GetRange, _GUICtrlSlider_SetRangeMax, _GUICtrlSlider_SetRangeMin
#include <GUIConstantsEx.au3> #include <GuiSlider.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $aRange, $idSlider ; Crée une GUI GUICreate("Slider Set Range", 400, 296) $idSlider = GUICtrlCreateSlider(2, 2, 396, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_ENABLESELRANGE)) GUISetState(@SW_SHOW) ; Obtient Range $aRange = _GUICtrlSlider_GetRange($idSlider) MsgBox($MB_SYSTEMMODAL, "Information", StringFormat("Range: %d - %d", $aRange[0], $aRange[1])) ; Définit Range _GUICtrlSlider_SetRange($idSlider, 20, 50) ; Obtient Range $aRange = _GUICtrlSlider_GetRange($idSlider) MsgBox($MB_SYSTEMMODAL, "Information", StringFormat("Range: %d - %d", $aRange[0], $aRange[1])) ; Boucle jusqu'à ce que l'utilisateur quitte. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example