Displaying value in an Edit/UpDown buddy in AutoHotKey

580 Views Asked by At

Is there anyway to get the textual chosen "word" to display in the spinner UI element as one flips through?

Whenever the user enters an up or down key the gosub display is called. So far though i have found only ways to display the index not the value...

#a::
words:= ["in","the","beginning","was","the","word"]

Gui, Add, Edit, w111 R1 vw, words3
Gui, Add, UpDown, w22 gdisplay vn Range1-6, 3

Gui, Show, x933 y0, test word display
return

display:
UD:=n
word:=words[UD]
n:=word
;Gui, Submit, NoHide
return
1

There are 1 best solutions below

3
On

How about using a ListBox instead:

Gui, Add, ListBox, R1 vMyList -VScroll, in|the|beginning|was|the|command|line
Gui, Add, UpDown, gDisplay
Gui, Show, , test word display

Exit

Display:
    Gui, Submit, NoHide
    ; MsgBox % MyList
return