# Function Reference

# _GUICtrlSlider_GetNumTics

Retrieves the number of tick marks from a slider

#include <GuiSlider.au3>
_GUICtrlSlider_GetNumTics ( $hWnd )

## Parameters

$hWnd | Control ID/Handle to the control

## Return Value

Returns an INT value as follow:
2 if no tick flag is set, for the beginning and ending ticks.
0 if $TBS_NOTICKS is set.
Otherwise, it takes the difference between the range minimum and maximum, divides by the tick frequency and adds 2.

## Related

_GUICtrlSlider_SetTicFreq

## Example

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

    Example()

    Func Example()
        Local $idSlider

        ; Create GUI
        GUICreate("Slider Get Num Tics", 400, 296)
        $idSlider = GUICtrlCreateSlider(2, 2, 396, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_ENABLESELRANGE))
        GUISetState(@SW_SHOW)

        ; Get Num Tics
        MsgBox($MB_SYSTEMMODAL, "Information", "Num Tics: " & _GUICtrlSlider_GetNumTics($idSlider))

        ; Set Tic Freq
        _GUICtrlSlider_SetTicFreq($idSlider, 1)

        ; Get Num Tics
        MsgBox($MB_SYSTEMMODAL, "Information", "Num Tics: " & _GUICtrlSlider_GetNumTics($idSlider))

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