Hello,
I am still new at coding with this. I am trying to make a dropdown list that will have different options depending on the dropdown above it. I tried an IF ELSE but it would always just show the last in the IF statements. I thought of having the list tied to a Excel sheet but it does not display the options. Any help would be great. Thanks
A variable DDL
-
- Posts: 4
- Joined: 18 May 2018, 21:01
Re: A variable DDL
Like this?
Code: Select all
#SingleInstance,Force
oList:="list 1||list 2|list 3|"
List_1:="a||b|c|d|e|"
List_2:="f||g|h|i|j|"
List_3:="k||l|m|n|o|"
Gui,1:+AlwaysOnTop
Gui,1:Color,Black
Gui,1:Add,DDL,x10 y10 w200 r3 AltSubmit vList_Selector gChange_List,% oList
Gui,1:Add,DDL,x10 y100 w200 r5 vSelected_List gShow_It,% List_1
Gui,1:Show,w220 h200,Is This It?
Gui,1:Submit,NoHide
return
GuiClose:
GuiEscape:
*^ESC::
ExitApp
Change_List:
Gui,1:Submit,NoHide
GuiControl,1:,Selected_List,% List_%List_Selector%
return
Show_It:
Gui,1:+OwnDialogs
Gui,1:Submit,NoHide
msgbox, you selected %Selected_List% in List %List_Selector%
return
-
- Posts: 4
- Joined: 18 May 2018, 21:01
Re: A variable DDL
Somewhat what I was looking for. But I want the options in the variable list to show only options based upon what is selected in the 1st list
Re: A variable DDL
chefgamer85 wrote:Somewhat what I was looking for. But I want the options in the variable list to show only options based upon what is selected in the 1st list
That is what it is doing.
if you select list 1 it shows options a,b,c,d,and e
if you select list 2 it shows options f,g,h,i,and j
etc.
-
- Posts: 4
- Joined: 18 May 2018, 21:01
Re: A variable DDL
I might be missing something then. When I used the code you showed, If list 2 is selected, it shows a,b,c,d,e,f,g,h,i and j. And if list 3 is selected it shows a, b, c, d, e, f, g, h, i, j, k, l, m, n and o
-
- Posts: 44
- Joined: 18 Aug 2016, 22:56
Re: A variable DDL
change this line
to this.
the bar "|" at the beginning will 'clear the ddl and then add the items, as it is, it is just appending items to the ddl.
Code: Select all
GuiControl,1:,Selected_List,% List_%List_Selector%
Code: Select all
GuiControl,1:,Selected_List,% "|" List_%List_Selector%
-
- Posts: 4
- Joined: 18 May 2018, 21:01
Re: A variable DDL
Thanks! That is what I was looking for it to do
Who is online
Users browsing this forum: Google [Bot], inseption86, jaka1, mebelantikjaya and 310 guests