Koda hilfe

07/26/2010 18:12 Omdi#1
Huhu
ich habe mit Koda form designer etwas deignt und dan den code
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"625103192124)
$Button1 GUICtrlCreateButton("Button1"24815341$WS_GROUP)
$Button2 GUICtrlCreateButton("Button2"288818541$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

    EndSwitch
WEnd 
So wie mache ich dass jetzt wenn ich Button1 klicke das Zbl eine MsgBox kommt mit hi?
07/26/2010 18:37 bladerofdarknes#2
PHP Code:
#include <GUIConstantsEx.au3> 
#Region ### START Koda GUI section ### Form= 
$Form1 GUICreate("Form1"625103192124
$Button1 GUICtrlCreateButton("Button1"24815341$WS_GROUP
$Button2 GUICtrlCreateButton("Button2"288818541$WS_GROUP
GUISetState(@SW_SHOW
#EndRegion ### END Koda GUI section ### 

While 
    $nMsg 
GUIGetMsg() 
    Switch 
$nMsg 
        
Case $GUI_EVENT_CLOSE 
        
Case $Button1
         MsgBox
("""test""hier dein text")        
Exit 

    EndSwitch 
WEnd 
07/26/2010 19:14 BLODDYKILL#3
PHP Code:
Opt("GUIOnEventMode"1
$Gui GUICreate("Guiname"625103192124)
$exitbutton GUICtrlCreateButton("Exit"24815341)
$Button2 GUICtrlCreateButton("Msgbox"288818541 )
Guictrlsetonevent($exitbutton,"_exit")
Guictrlsetonevent($Button2,"_Msgbox")
GUISetOnEvent(-3,"_exit")
GUISetState()
Func _exit()
    Exit
EndFunc
Func _Msgbox
()
    
MsgBox(0,"","Hi")
    
EndFunc
While 1
Sleep
(100)
WEnd 
Ebenso auch mit der Guieventmode methode möglich.
Wichtig: Hör am besten wenn du das System geblickt hasst mit Koda auf und fang dann selber überlegen an. Ist Teils sogar besser und später schadet es nicht wennst dich mit normalem Gui-Coding auskennst.
07/26/2010 20:19 omer36#4
schau oben wie es blader gemacht hatt..
nochmal zum mitschreiben:
um den button zuzuweisen muss tdu (am besten unter dem Exit)
PHP Code:
        Case $Button1
        
;hier den code 
wenn dein code länger ist, kannst du es auch so machen:
PHP Code:
        Case $Button1
        msg
()

...
...
Func msg()
MsgBox("""test""hier dein text")  
EndFunc 
kapische?