can anyone help me get this to work.
I need to be able to set the name of the selection, so I can trigger more code to do something.
Code: Select all
Gui Add, ListBox, w400 r5 vMyListBoxVariable gMyListBoxLabel, One|Two|Three|Four|Five
Gui Show, , ListBox
Return
GuiClose:
ExitApp
MyListBoxLabel:
GuiControlGet ItemText, , MyListBoxVariable
GuiControl +AltSubmit, MyListBoxVariable
GuiControlGet ItemIndex, , MyListBoxVariable
GuiControl -AltSubmit, MyListBoxVariable
MsgBox 0, %MyListBoxVariable%, You selected the item with index %ItemIndex% and text %ItemText%
Return