RandomGuest Posted August 16, 2007 Share Posted August 16, 2007 (edited) Sooo...How do I make something happen when I push one of the buttons? For example the cancel button make the window exit and the Start button makes Internet Explorer start? Any help would be great! Thanks! My script so far (copied the 1-2-3 script thing xD ) : #include <GUIConstants.au3> GUICreate("My GUI Button") Opt("GUICoordMode",5) $button_2 = GUICtrlCreateButton ("Cancel", 60, 30, 60) $button_1 = GUICtrlCreateButton ( "Start", 0, -1, 60) GUISetState () While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Edited August 16, 2007 by RandomGuest Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 16, 2007 Share Posted August 16, 2007 Sooo...How do I make something happen when I push one of the buttons? For example the cancel button make the window exit and the Start button makes Internet Explorer start? Any help would be great! Thanks! Include them in your message loop: While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $button_1 MsgBox(64, "Click!", "You clicked button one!") Case $button_1 MsgBox(64, "Click!", "You clicked button two!") EndSwitch Wend Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Gif Posted August 16, 2007 Share Posted August 16, 2007 #include <GUIConstants.au3> #include <IE.au3> GUICreate("My GUI Button") Opt("GUICoordMode",5) $button_2 = GUICtrlCreateButton ("Cancel", 60, 30, 60) $button_1 = GUICtrlCreateButton ( "Start", 0, -1, 60) GUISetState () While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Or $msg = $button_2 Then Exit If $msg = $button_1 Then _IECreate() Wend Link to comment Share on other sites More sharing options...
RandomGuest Posted August 16, 2007 Author Share Posted August 16, 2007 Thank both of you! <3! 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