[COLOR="MediumTurquoise"]Hab einen Programm erstellt werd hier aber zu lern zwecken nur den Code abgebildet. Könnt euch die Auswirkungen ansehen ;-).

Hoffe der code ist einleuchtend.[/COLOR]
Alles anzeigen
[COLOR="MediumTurquoise"]Der Code ist 100% Naja ich habe den Koda Form desiner und das Code Wizard tool benutzt. Auch kommentare 100% von mir.[/COLOR]
[COLOR="YellowGreen"]
Hier mal ein Bild von dem Code Wizard und dem Code Form desiner.[/COLOR]
mmo-core.de/attachment/96/mmo-core.de/attachment/97/
Wenns euch gefallen hab gebt doch pls 'n Karma/thx.
Vielen dank an xDrago[COLOR="Red"] für seinen RadioButton/Checkbox Guide[/COLOR]
Mfg Temo
Hoffe der code ist einleuchtend.[/COLOR]
Brainfuck-Quellcode
- [COLOR="Magenta"]#include[/COLOR] [COLOR="Silver"]<GUIConstants.au3>[/COLOR]
- [COLOR="DarkOrchid"]#Region ### START Koda GUI section ### Form=[/COLOR]
- [COLOR="Lime"]#cs
- Das ist der Stylebereich wo Variablen definiert werden, Buttons,Labels,erstellt werden.
- #ce[/COLOR]
- [COLOR="Red"]$Form1[/COLOR] = GUICreate("Wie geht so?", 213, 184, 193, 133)[COLOR="SeaGreen"]; Das Windows Fenster[/COLOR]
- GUISetIcon("")[COLOR="SeaGreen"]; Hier kannst du optional den Pfad eines icons angeben was oben in der linken Ecke des Fensters zusehen ist.[/COLOR]
- [COLOR="Red"]$Radio1[/COLOR] = GUICtrlCreateRadio("Perfekt", 16, 48, 73, 25)[COLOR="SeaGreen"];Radio Button mit der Aufschrift "Perfekt"[/COLOR]
- [COLOR="Red"]$Radio2[/COLOR] = GUICtrlCreateRadio("Sehr gut!", 16, 72, 73, 25)[COLOR="SeaGreen"];Radio Button mit der Aufschrift "Sehr gut![/COLOR]"
- [COLOR="Red"]$Label1[/COLOR] = GUICtrlCreateLabel("Wie geht's dir denn heute?", 16, 16, 161, 20);Label mit der Frage "Wie geht's dir denn heute!"
- [COLOR="Red"]$Radio3[/COLOR] = GUICtrlCreateRadio("Gut", 16, 96, 73, 25)[COLOR="SeaGreen"];Radio Button mit der Aufschrift "Gut"[/COLOR]
- [COLOR="Red"]$Radio4[/COLOR] = GUICtrlCreateRadio("Naja", 96, 48, 105, 25)[COLOR="SeaGreen"];Radio Button mit der Aufschrift "Naja"[/COLOR]
- [COLOR="Red"]$Radio5[/COLOR] = GUICtrlCreateRadio("Schlecht", 96, 72, 105, 25)[COLOR="SeaGreen"];Radio Button mit der Aufschrift "Schlecht"[/COLOR]
- [COLOR="Red"]$Radio6[/COLOR] = GUICtrlCreateRadio("sehr schlecht", 96, 96, 105, 25)[COLOR="SeaGreen"];Radio Button mit der Aufschrift "Sehr schlecht"[/COLOR]
- [COLOR="Red"]$Button1[/COLOR] = GUICtrlCreateButton("Enter", 16, 128, 185, 49, 0)[COLOR="SeaGreen"];Button mit der Aufschrift "Enter"[/COLOR]
- GUISetState(@SW_SHOW)
- [COLOR="DarkOrchid"]#EndRegion ### END Koda GUI section ###[/COLOR]
- [COLOR="SeaGreen"];------------------------------------------------------------------------------------------[/COLOR]
- [COLOR="Lime"]#cs Ab hier beginnt das Programm. Alles was ausgeführt werden soll muss in der while schleife stehen.
- while schleifen beginnen mit while 1 und enden mit WEnd.
- #ce[/COLOR]
- While 1 ; While Schleife wird geöffnet
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $Button1 [COLOR="SeaGreen"]; Case bedeutet das wenn man drauf klickt in diesem Fall auf den button Enter (der Name ist button1 du kannst ihn natürllich auch ändern)[/COLOR]
- If GUICtrlRead ($Radio1) = 1 Then ; Dies ist wie man sieht ein if schleife. Das GuiCtrlRead () ließt den inhalt des in der klammer stehen den aus.
- ;----------------------------------------------------------------
- [COLOR="Lime"]#cs Mit diesem Teil kenne ich mich nicht ganz so gut aus weil er mit dem Code Wizard Tool erstellt worden ist.
- Das Code Wizard Tool findest du unter Tools oben in der Menüleiste und dann einfach auf Code Wizard klicken.
- #ce [/COLOR]
- If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
- $iMsgBoxAnswer = MsgBox(4,"MotiKünster","Schön das es dir so gut geht. Ich freu mich für dich.",10)
- [COLOR="SeaGreen"]; $iMsgBoxAnswer ist der Variablen Name den kannst du natürlich beliebig ändern aber musst dann
- [COLOR="SeaGreen"]; auch den Variablen Namen ändern bei allen anderen wo die Variable drin vorkommt.[/COLOR]
- Select[/COLOR]
- Case $iMsgBoxAnswer = 6 ; [COLOR="SeaGreen"]Das ist praktisch wenn du auf den Button JA drücks passiert ...[/COLOR]
- MsgBox (0, "Antwort" ,"Schön das dir mein Rat gefallen hat.^^", 2)
- Case $iMsgBoxAnswer = 7 [COLOR="SeaGreen"]; Das ist praktisch wenn du auf den Button Nein drücks passiert ...[/COLOR]
- MsgBox (0, "Antwort", "Naja wenn du meine Hilfe nicht brauchst. :/ Leave me alone!!! :-(", 3)
- Case $iMsgBoxAnswer = -1[COLOR="SeaGreen"] ; Weiß leider nicht genau was das ist[/COLOR]
- EndSelect
- EndIf ; Beendet eine if schleife
- [COLOR="SeaGreen"];--------------------------------------------------[/COLOR]
- #cs Das hier läuft erstmal nach dem gleichen Chema
- Ich empfehle das Code Wizard Tool und den Koda Form desiner
- #ce
- If GUICtrlRead ($Radio2) = 1 Then
- If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
- $iMsgBoxAnswer = MsgBox(4,"MotiKünster","Schön das es dir gut geht.",10)
- Select
- Case $iMsgBoxAnswer = 6
- MsgBox (0, "Antwort" ,"Schön das dir mein Rat gefallen hat.^^", 2)
- Case $iMsgBoxAnswer = 7
- MsgBox (0, "Antwort", "Naja wenn du meine Hilfe nicht brauchst. :/ Leave me alone!!! :-(", 3)
- Case $iMsgBoxAnswer = -1
- EndSelect
- EndIf [COLOR="SeaGreen"]; Endet die if schleife[/COLOR]
- If GUICtrlRead ($Radio3)= 1 Then
- If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
- $iMsgBoxAnswer = MsgBox(4,"MotiKünster","Du fühlst dich gut. Es könnte zwar Besser sein aber schön!",10)
- Select
- Case $iMsgBoxAnswer = 6
- MsgBox (0, "Antwort" ,"Schön das dir mein Rat gefallen hat.^^", 2)
- Case $iMsgBoxAnswer = 7
- MsgBox (0, "Antwort", "Naja wenn du meine Hilfe nicht brauchst. :/ Leave me alone!!! :-(", 3)
- Case $iMsgBoxAnswer = -1
- EndSelect
- EndIf [COLOR="SeaGreen"]; Endet die if schleife[/COLOR]
- If GUICtrlRead ($Radio4)= 1 Then
- If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
- $iMsgBoxAnswer = MsgBox(4,"MotiKünster","Hm, vlt fühlst du dich Morgen besser.",10)
- Select
- Case $iMsgBoxAnswer = 6
- MsgBox (0, "Antwort" ,"Schön das dir mein Rat gefallen hat.^^", 2)
- Case $iMsgBoxAnswer = 7
- MsgBox (0, "Antwort", "Naja wenn du meine Hilfe nicht brauchst. :/ Leave me alone!!! :-(", 3)
- Case $iMsgBoxAnswer = -1
- EndSelect
- EndIf ;[COLOR="SeaGreen"] Endet die if schleife[/COLOR]
- If GUICtrlRead ($Radio5)= 1 Then
- If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
- $iMsgBoxAnswer = MsgBox(4,"MotiKünster","Mach dir nichts drauß. Es gibt mal gute mal schechte Zeiten",10)
- Select
- Case $iMsgBoxAnswer = 6
- MsgBox (0, "Antwort" ,"Schön das dir mein Rat gefallen hat.^^", 2)
- Case $iMsgBoxAnswer = 7
- MsgBox (0, "Antwort", "Naja wenn du meine Hilfe nicht brauchst. :/ Leave me alone!!! :-(", 3)
- Case $iMsgBoxAnswer = -1
- EndSelect
- EndIf[COLOR="SeaGreen"]; Endet die if schleife[/COLOR]
- If GUICtrlRead ($Radio6)= 1 Then
- If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
- $iMsgBoxAnswer = MsgBox(4,"MotiKünster","Mach etwas was dich motiviert. Geb deine Lebenslust nicht auf!",10)
- Select
- Case $iMsgBoxAnswer = 6
- MsgBox (0, "Antwort" ,"Schön das dir mein Rat gefallen hat.^^", 2)
- Case $iMsgBoxAnswer = 7
- MsgBox (0, "Antwort", "Naja wenn du meine Hilfe nicht brauchst. :/ Leave me alone!!! :-(", 3)
- Case $iMsgBoxAnswer = -1
- EndSelect
- EndIf [COLOR="SeaGreen"]; Endet die if schleife[/COLOR]
- EndSwitch
- WEnd[COLOR="SeaGreen"] ; Ende de while schleife while schleifen und if schleifen können beliebig [/COLOR]verschachtelt werden.
[COLOR="MediumTurquoise"]Der Code ist 100% Naja ich habe den Koda Form desiner und das Code Wizard tool benutzt. Auch kommentare 100% von mir.[/COLOR]
[COLOR="YellowGreen"]
Hier mal ein Bild von dem Code Wizard und dem Code Form desiner.[/COLOR]
mmo-core.de/attachment/96/mmo-core.de/attachment/97/
Wenns euch gefallen hab gebt doch pls 'n Karma/thx.
Vielen dank an xDrago[COLOR="Red"] für seinen RadioButton/Checkbox Guide[/COLOR]
Mfg Temo