The code is a simple way to change a Updown box in values that aren't 1. so you can change Inc to any value and it should work.
P.S im sure someone smarter than me can make an easier way, but i couldn't find any help online for this!
Code: Select all
; AutoHotkey Version: 2.0.2.00
; Language: English
; Platform: Win10
; Function: adjust upDown control in steps that arent 1
Inc := 0.25 ; amount to increment by
myGUI :=Gui()
myGUI.Add("Text", , "My value")
myGUI.Add("Edit", "ys w80 vTextValue", "5")
myGUI.Add("upDown", "-2 vUDValue Range-1-1").OnEvent("Change", UD_change) ;-2 to make UD and edit seperate
myGUI.Show()
myGUI.submit(0)
return
UD_change(*) ; updown clicked
{
FormVars := myGUI.Submit(0)
If( FormVars.UDValue < 0 ) ; decide if value should go up or down
{
newValue := FormVars.TextValue - Inc
}
Else
{
newValue := FormVars.TextValue + Inc
}
myGUI['UDValue'] = 0 ;set UD to 0 so value out is -1 or 1
myGUI['TextValue'].Value := newValue ;set the value back in the form
return
}