[AutoIt] Brauche Hilfe bei GUI

04/18/2010 12:45 Coolchecker#1
Hallo

ich bin im Bereich GUI für AutoIt noch ziemlicher Anfänger.

Eine ganz einfache Frage:

Wie belege ich ein OnClick Ereignis auf einen Button?
Also das wenn man drauf drückt das was bestimmtes passiert?

Ich weiß es ist ziemlich simpel aber ich weiß es trotzdem nicht. xD

LG
04/18/2010 12:50 epiTR#2
Gui erstellen und dann bei Switch:

Case $Buttonx
;code
Case $Button2x
;code...
04/18/2010 13:10 HardCore.1337#3
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"625443192124)
$Button1 GUICtrlCreateButton("Button1"104327525$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            Machwas
() ;Dein Code der ausgeführt wird

    
EndSwitch
WEnd

Func Machwas
()
    ;
Dein Code
EndFunc 
04/18/2010 14:38 mipez#4
Und bei GUIOnEventMode

GUICtrlSetOnEvent ( $button, "funktion" )