Jump to content

GUICtrlCreateSlider With comma ( , )


 Share

Recommended Posts

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>

Example()

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)
    GUISetState(@SW_SHOW)
    GUICtrlSetData($idSlider1, 45.2 * 10) ; set cursor to 45.2

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

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

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

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...