Jump to content

slider snap to 5,10,15?


 Share

Recommended Posts

#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>

Dim $hGUI = GUICreate('Test', 200, 250)
Dim $Slider = GUICtrlCreateSlider(25, 20, 150, 35)
Dim $Static = GUICtrlCreateLabel('', 25, 60, 100, 23)

GUICtrlSetLimit($Slider, 5)
GUICtrlSendMsg($Slider, $TBM_SETLINESIZE, 0, 1)
GUICtrlSendMsg($Slider, $TBM_SETPAGESIZE, 0, 2)
GUICtrlSendMsg($Slider, $TBM_SETTICFREQ, 1, 0)
GUICtrlSetData($Static, '0')
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $Slider
            GUICtrlSetData($Static, String(GUICtrlRead($Slider)*20))
        Case -3
            ExitLoop
    EndSwitch
WEnd

GUIDelete()
Exit

Edited by Authenticity
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...