Sign in to follow this  
Followers 0
xuzo

Drop down closes the GUI instead of submit

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
1 person likes this

Share this post


Link to post
Share on other sites

Thanks nice person,

Yes that works, I've also added a line of code like this:

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

[solved]

Share this post


Link to post
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
Sign in to follow this  
Followers 0