Jump to content

Making pushing a button on a window(Dont need help more)


Recommended Posts

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
Link to comment
Share on other sites

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

#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

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...