Jump to content

Drop down closes the GUI instead of submit


xuzo
 Share

Recommended Posts

The title is not quite right I think...

What I mean is this, now the GUI does this:

- When you select the drop down, it saves the value, then closes the GUI before the user gets a chance to hit submit

Would I want it to do is:

- Select the drop down, then click submit, then close the GUI

#include
#include
#include
#include
#include
WinSetState("[CLASS:SciTEWindow]", "", @SW_MINIMIZE)
HotKeySet("{ESC}", "Escape")
Global $FFClass = "[CLASS:MozillaWindowClass]"

While Not WinExists($FFClass)
Switch MsgBox(16 + 5 + 262144, "Error!", "Please Start Firefox.")
Case 4
ContinueLoop
Case 2
Escape()
EndSwitch
WEnd

If WinExists($FFClass) Then
WinActivate($FFClass)
MsgBox(48, "Info!", "Please don't touch your keyboard or mouse as task executes, takes about 3 seconds.")
Else
MsgBox(16, "", "")
EndIf

;start GUI sequence

Global $Form1 = GUICreate("", 520, 70)
GUISetIcon("D:FilesAxialis_IconsAxialis-Colored-Buttons-Square-Black-IcoIcoApplications.ico", -1)
Global $extensions = GUICtrlCreateCombo("extensions", 119, 35, 145, 25, BitOR($GUI_SS_DEFAULT_COMBO, $WS_HSCROLL))
GUICtrlSetData(-1, "ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bbt|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sk|sl|sm|sn|so|sr|ss|st|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|za|zm|zw")
Global $google_dot = GUICtrlCreateLabel("http://www.google.", 10, 36, 97, 17)
Global $submit = GUICtrlCreateButton("Submit", 283, 32, 75, 25)
Global $choose_extension_text = GUICtrlCreateLabel("Please choose your Google contry extension, for example google.ca is Canada, Google.co.uk is UK ect...", 10, 10, 502, 17)
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $extensions
$sSelection = GUICtrlRead($extensions)
ExitLoop ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
EndSwitch
WEnd


Func Escape()
Exit
EndFunc ;==>Escape
GUIDelete()

MsgBox(0, "Title", $sSelection)
Edited by xuzo
Link to comment
Share on other sites

Try this:

Case $submit
            $sSelection = GUICtrlRead($extensions)
            MsgBox(0,"","You selected " & $sSelection & " extention...")
         ExitLoop ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Instead of:

Case $extensions
            $sSelection = GUICtrlRead($extensions)
            ExitLoop ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...