anystupidassname Posted August 10, 2005 Share Posted August 10, 2005 Hi, I've looked and there are multiple listbox examples, but I couldn't find one to help me with my situation. I have a GUI that is created with only the listbox and a list of items. I'd like the window to exit the script if closed or set a variable and close and go on to do the rest of my script (which includes another gui) if a listed item is clicked on. Thanks for any help! GuiCreate("Day/URL Tool", 280, 349,(@DesktopWidth-280)/2, (@DesktopHeight-349)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $List_1 = GuiCtrlCreateList("", 0, 40, 280, 305) GUICtrlSetData($List_1, "1|2") $Label_1 = GuiCtrlCreateLabel("Choose a crossword puzzle provider:", 10, 10, 180, 20) GuiSetState() While 1 $msg = GuiGetMsg() Sleep(100) Select Case $msg = $List_1 $L = GUICtrlRead($List_1) ;MsgBox(0,"",$L) ;ExitLoop Case $msg = $GUI_EVENT_CLOSE Exit Case Else EndSelect WEnd GUISetState(@SW_HIDE) ... This is what I have but I'm thinking I need to use oneventmode or something. This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
Josbe Posted August 10, 2005 Share Posted August 10, 2005 ... Case $msg = $List_1 $L = GUICtrlRead($List_1) ;MsgBox(0,"",$L) ;ExitLoop ???...And that line don't it solves? AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
anystupidassname Posted August 10, 2005 Author Share Posted August 10, 2005 And that line don't it solves? <{POST_SNAPBACK}>Thanks. I ended up doing it a little differently though. The ExitLoop was commented out because I was trying to use a GUISetOnEvent. This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now