Sets the starting and ending positions for the available selection range
#include <GuiSlider.au3>
_GUICtrlSlider_SetSel ( $hWnd, $iMinimum, $iMaximum )
$hWnd | Control ID/Handle to the control |
$iMinimum | Starting logical position for the selection range |
$iMaximum | Ending logical position for the selection range |
This function is ignored if the slider does not have the $TBS_ENABLESELRANGE style.
_GUICtrlSlider_SetSel() allows you to restrict the pointer to only a portion of the range available to the slider.
_GUICtrlSlider_ClearSel, _GUICtrlSlider_GetSel, _GUICtrlSlider_SetSelEnd, _GUICtrlSlider_SetSelStart
#include <GUIConstantsEx.au3>
#include <GuiSlider.au3>
#include <MsgBoxConstants.au3>
Example()
Func Example()
; Create GUI
GUICreate("Slider Get/Set Sel (v" & @AutoItVersion & ")", 400, 296)
Local $idSlider = GUICtrlCreateSlider(2, 2, 396, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_ENABLESELRANGE))
GUISetState(@SW_SHOW)
; Set Sel
_GUICtrlSlider_SetSel($idSlider, 10, 50)
; Get Sel
Local $aSel = _GUICtrlSlider_GetSel($idSlider)
MsgBox($MB_SYSTEMMODAL, "Information", StringFormat("Sel: %d - %d", $aSel[0], $aSel[1]))
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example