[AutoIt3] Buttons zuweisen

11/27/2009 17:36 HighLvleR#1
Hallo E*PvP,

Hab wieder mal ein Problem >.<

Ich hab en GUI gemacht aber die Tasten weiss ich ned wie auf eine Funktion zuweisen

PHP Code:
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("STARTER"301201193125)
GUISetIcon("C:\Users\Beni\Desktop\favicon.ico")
$Button1 GUICtrlCreateButton("START"32120105490)
$Button2 GUICtrlCreateButton("EXIT"16812097490)
$Label1 GUICtrlCreateLabel("Testscript nach den AutoIT3"321622527)
GUICtrlSetFont(-1148000"Calibri")
$Label2 GUICtrlCreateLabel("Grundlagen 1-4"886412627)
GUICtrlSetFont(-1148000"Calibri")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit

    EndSwitch
WEnd
if $Button1 Then
    Run 
("script.exe")
ElseIf 
$Button2 Then
    Sleep 
(1000)
    
MsgBox (0"Copyright!""Dieser Script wurde von ******  geschrieben Copyright 2009")
    
Sleep (1500)
    Exit
    EndIf 
Ich habs mal mit If $Button1 und func $button1 versucht funzt ned Aber eigentlich logisch :rolleyes:

mfG
11/27/2009 17:40 AllesVergeben#2
Code:
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("STARTER", 301, 201, 193, 125)
GUISetIcon("C:\Users\Beni\Desktop\favicon.ico")
$Button1 = GUICtrlCreateButton("START", 32, 120, 105, 49, 0)
$Button2 = GUICtrlCreateButton("EXIT", 168, 120, 97, 49, 0)
$Label1 = GUICtrlCreateLabel("Testscript nach den AutoIT3", 32, 16, 225, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
$Label2 = GUICtrlCreateLabel("Grundlagen 1-4", 88, 64, 126, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        [B]Case $Button1
            Run ("script.exe")[/B]
        [B]Case $Button2
           Sleep (1000)
           MsgBox (0, "Copyright!", "Dieser Script wurde von ******   geschrieben Copyright 2009")
          Sleep (1500)
           Exit[/B]
            

    EndSwitch
WEnd
Schau dir den Fetten teil an ;)