how to update another dropdownlist value depending on another dropdown list value

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
takayo97
Posts: 63
Joined: 09 Jun 2018, 16:30

how to update another dropdownlist value depending on another dropdown list value

25 Sep 2018, 22:33

say I ve two dropdownlist A and B

Code: Select all


gui Add, DropDownList, vList1 gList1 x+0 y1 w110, xxxxx||yyyyy|zzzzzz     ; dropdownlist A
gui Add, DropDownList, vList2 gList2 x+0 y1 w110, option 1||option 2|option 1  ; dropdownlist B
gui show
When item of option 2 selected in dropdownlist B, it will update value of dropdownlist A to e.g. zzzzzz
User avatar
AlphaBravo
Posts: 586
Joined: 29 Sep 2013, 22:59

Re: how to update another dropdownlist value depending on another dropdown list value

25 Sep 2018, 23:29

Code: Select all

gui Add, DropDownList, vList1 gList1 x+0 y1 w110, xxxxx||yyyyy|zzzzzz     					; dropdownlist A
gui Add, DropDownList, vList2 gList2 x+0 y1 w110 AltSubmit, option 1||option 2|option 3 	; dropdownlist B
gui show
return

list1:
return

list2:
GuiControlGet, var,, list2
GuiControl, Choose, list1, % var
return
takayo97
Posts: 63
Joined: 09 Jun 2018, 16:30

Re: how to update another dropdownlist value depending on another dropdown list value

26 Sep 2018, 05:25

Code: Select all

gui Add, DropDownList, vList1 gList1 x+0 y1 w110, xxxxx||yyyyy|zzzzzz     					; dropdownlist A
gui Add, DropDownList, vList2 gList2 x+5 y1 w110 AltSubmit, option 1||option 2|option 3 	; dropdownlist B
gui show
return

list1:
return

list2:
gui submit , nohide
GuiControlGet, var,, list2
GuiControl, Choose, list1, % var
msgbox %list1%
The ui's part is updated. However, the value of List1 variable stored last value but not the updated value
User avatar
AlphaBravo
Posts: 586
Joined: 29 Sep 2013, 22:59

Re: how to update another dropdownlist value depending on another dropdown list value

26 Sep 2018, 10:25

Code: Select all

gui Add, DropDownList, vList1 gList1 x+0 y1 w110, xxxxx||yyyyy|zzzzzz     					; dropdownlist A
gui Add, DropDownList, vList2 gList2 x+5 y1 w110 AltSubmit, option 1||option 2|option 3 	; dropdownlist B
gui show
return

list1:
gui submit , nohide
msgbox %list1%
return

list2:
gui submit , nohide
GuiControlGet, var,, list2
GuiControl, Choose, list1, % var
gosub, list1		; I didn't think you have to do that, oh well..
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 406 guests