Sign in to follow this  
Followers 0
RandomGuest

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

4 posts in this topic

#1 ·  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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thank both of you! <3!

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