Zitatalso eig. nur addieren, subtrahieren, multipliezieren und dividieren
danke wie ein taschenrechner funktioniert weiß ich
ich wollte eher wissen wie deiner funktionieren soll. da du die zahlen 0-9 nur einmal hast aber 2 Inputfelder in die ein wert gesetzt werden soll.
jetz hab ich aus deiner gui einfach mal einen gebastelt. hilft dir halt jetz wenig das zu verstehen ...
Es würde zum Beispiel so funktionieren.
Spoiler anzeigen
#include <GUIConstantsEx.au3>
Dim $in1 = True
[/autoit] [autoit][/autoit] [autoit]#region ### START Koda GUI section ### Form=c:\users\patrik finger\form1.kxf
$Form1_1 = GUICreate("Crocojunk", 367, 326, 193, 125)
$Pic1 = GUICtrlCreatePic("croco.jpg", 0, 0, 364, 100)
$Input1 = GUICtrlCreateInput("", 8, 128, 121, 21)
$Input2 = GUICtrlCreateInput("", 232, 128, 121, 21)
$Input3 = GUICtrlCreateInput("", 160, 128, 41, 21)
$Button1 = GUICtrlCreateButton("9", 16, 160, 25, 25, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Times New Roman")
$Button2 = GUICtrlCreateButton("8", 49, 160, 23, 25, 0)
$Button3 = GUICtrlCreateButton("7", 80, 160, 27, 25, 0)
$Button4 = GUICtrlCreateButton("6", 112, 160, 27, 25, 0)
$Button5 = GUICtrlCreateButton("5", 16, 192, 27, 25, 0)
$Button6 = GUICtrlCreateButton("4", 48, 192, 27, 25, 0)
$Button7 = GUICtrlCreateButton("3", 80, 192, 27, 25, 0)
$Button8 = GUICtrlCreateButton("2", 112, 192, 27, 25, 0)
$Button9 = GUICtrlCreateButton("1", 16, 224, 27, 25, 0)
$Button10 = GUICtrlCreateButton("0", 48, 224, 27, 25, 0)
$Button11 = GUICtrlCreateButton(",", 80, 224, 27, 25, 0)
$Button12 = GUICtrlCreateButton("addieren", 160, 160, 75, 25, 0)
$Button13 = GUICtrlCreateButton("dividieren", 160, 192, 75, 25, 0)
$Button14 = GUICtrlCreateButton("multipliezieren", 160, 224, 75, 25, 0)
$Button15 = GUICtrlCreateButton("subtrahieren", 248, 160, 75, 25, 0)
$Input4 = GUICtrlCreateInput("", 120, 296, 121, 21)
$Button16 = GUICtrlCreateButton("Berechnen", 112, 256, 139, 25, 0)
$Label1 = GUICtrlCreateLabel("Ergebnis>>", 24, 296, 72, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1, $Button2, $Button3, $Button4, $Button5, $Button6, $Button7, $Button8, $Button9, $Button10
If $in1 Then
GUICtrlSetData($Input1, GUICtrlRead($Input1) & GUICtrlRead($nMsg))
Else
GUICtrlSetData($Input2, GUICtrlRead($Input2) & GUICtrlRead($nMsg))
EndIf
Case $Button12
$in1 = False
GUICtrlSetData($Input3, "+")
Case $Button13
$in1 = False
GUICtrlSetData($Input3, "/")
Case $Button14
$in1 = False
GUICtrlSetData($Input3, "*")
Case $Button15
$in1 = False
GUICtrlSetData($Input3, "-")
Case $Button16
GUICtrlSetData($Input4, Execute(GUICtrlRead($Input1) & GUICtrlRead($Input3) & GUICtrlRead($Input2)))
GUICtrlSetData($Input1, "")
GUICtrlSetData($Input2, "")
GUICtrlSetData($Input3, "")
$in1 = True
EndSwitch
WEnd
edit: minifehler verbessert