rayane888 Posted February 13, 2017 Posted February 13, 2017 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
Gianni Posted February 14, 2017 Posted February 14, 2017 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 rayane888 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now