byteme Posted July 6, 2005 Share Posted July 6, 2005 Hi Everybody. I haven't worked with GUI's for too long, but I am getting there. I have a problem. I have a combo box that has default writing in it telling people to click the dropdown and pick something. if they don't do that, and just hit the submit button, I need the script to give a message box, then restart the loop until they pick something different. here is part of my code, with a couple variables changed, but it is the same concept in my script: if $msg = $button_3 Then $t = GUICtrlRead($combo_2) if $t = "whatever1" Then $pc = "pc1" ElseIf $t = "whatever2" Then $pc = "pc2" ElseIf $t = "whatever3" Then $pc = "pc3" ElseIf $t = "whatever4" Then $pc = "pc4" ElseIf $t = "whatever5" Then $pc = "pc5" ElseIf $t = "whatever6" Then $pc = "pc6" ElseIf $t = "whatever7" Then $pc = "pc7" ElseIf $t = "Please click dropdown arrow to select" Then ; i need it to restart the loop here. go back and let the user click the drop down again and keep doing it until they pick something else EndIf guidelete() any ideas on how to do this? Thanks everybody! byteme Link to comment Share on other sites More sharing options...
blindwig Posted July 6, 2005 Share Posted July 6, 2005 (edited) Local $AllDone=0, $msg While Not $AllDone $msg=GUIGetMsg() if $msg = $button_3 Then $t = GUICtrlRead($combo_2) If $t = "Please click dropdown arrow to select" Then MsgBox(8192, 'Invalid Selection', 'Please select an option in the drop-down box') Else $AllDone = 1 EndIf EndIf WEnd ;continue program here guidelete() Edited July 6, 2005 by blindwig My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
byteme Posted July 7, 2005 Author Share Posted July 7, 2005 Thank you blindwig! That worked great! I was pulling my hair out trying to figure that out. I guess I have a lot more to learn about loops and gui's. Thanks for the help! Byteme 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