Jump to content

GUICtrlCreateSlider With comma ( , )

Recommended Posts


Hello all Autoit coder i need  GUICtrlCreateSlider from 1 to 100 but with comma start is  1 then 1.1 then 1.2 the 1.3 untile  4  but i see that slider support just 1 2 3 4 ..... thx

Share this post

Link to post
Share on other sites

multiply values by 10 when you set values to the slider; divide values you read from the slider  by 10 instead to get slider position.

modified version from the help:

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


Func Example()

    GUICreate("slider", 220, 100, 100, 200)
    GUISetBkColor(0x00E0FFFF) ; will change background color

    Local $idSlider1 = GUICtrlCreateSlider(10, 10, 200, 20)
    GUICtrlSetLimit(-1, 1000, 10) ; change min/max value ( 1 to 100 becomes min = 1*10 to max = 100*10)
    Local $idButton = GUICtrlCreateButton("Value?", 75, 70, 70, 20)
    GUICtrlSetData($idSlider1, 45.2 * 10) ; set cursor to 45.2

    Local $idMsg
    ; Loop until the user exits.
        $idMsg = GUIGetMsg()

        If $idMsg = $idButton Then
            MsgBox($MB_SYSTEMMODAL, "slider1", GUICtrlRead($idSlider1) / 10, 2) ; divide by 10 when you read
    Until $idMsg = $GUI_EVENT_CLOSE
EndFunc   ;==>Example


  • Like 1

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post

Link to post
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


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.