Jump to content

Recommended Posts

Posted (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 by RandomGuest
Posted

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

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
×
×
  • Create New...