Hallo,
ich hab hier ein Taschenrechner mal gemacht!
Habt ihr noch i-welche Tipps für mich oder ist das so gut für den anfang? (ich habe mit "coden" vor 2-3 tagen angefangen ^^)
[cs]#include <GUIConstants.au3>
$Form1_1 = GUICreate("Form1", 213, 211, 330, 155)
$Button1 = GUICtrlCreateButton("0", 8, 168, 73, 33, 0)
$Button2 = GUICtrlCreateButton("1", 8, 128, 33, 33, 0)
$Button3 = GUICtrlCreateButton("2", 48, 128, 33, 33, 0)
$Button4 = GUICtrlCreateButton("3", 88, 128, 33, 33, 0)
$Button5 = GUICtrlCreateButton("4", 8, 88, 33, 33, 0)
$Button6 = GUICtrlCreateButton("5", 48, 88, 33, 33, 0)
$Button7 = GUICtrlCreateButton("6", 88, 88, 33, 33, 0)
$Button8 = GUICtrlCreateButton("7", 8, 48, 33, 33, 0)
$Button9 = GUICtrlCreateButton("8", 48, 48, 33, 33, 0)
$Button10 = GUICtrlCreateButton("9", 88, 48, 33, 33, 0)
$Button11 = GUICtrlCreateButton("+", 128, 48, 33, 33, 0)
$Button12 = GUICtrlCreateButton("-", 128, 88, 33, 33, 0)
$Button13 = GUICtrlCreateButton("*", 128, 128, 33, 33, 0)
$Button14 = GUICtrlCreateButton("/", 128, 168, 33, 33, 0)
$Button15 = GUICtrlCreateButton("=", 168, 120, 33, 81, 0)
$Button16 = GUICtrlCreateButton("C", 168, 48, 33, 65, 0)
$Button17 = GUICtrlCreateButton(".", 88, 168, 33, 33, 0)
$Input1 = GUICtrlCreateInput("", 8, 16, 193, 21)
GUISetState(@SW_SHOW)
While 1
If (StringInStr(GUICtrlRead($Input1), ".", 0, 2) > 0) Then
GUICtrlSetData($Input1, StringTrimRight(GUICtrlRead($Input1), 1))
EndIf
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "0")
Case $Button2
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "1")
Case $Button3
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "2")
Case $Button4
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "3")
Case $Button5
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "4")
Case $Button6
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "5")
Case $Button7
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "6")
Case $Button8
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "7")
Case $Button9
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "8")
Case $Button10
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "9")
Case $Button17
GUICtrlSetData($Input1, GUICtrlRead($Input1) & ".")
Case $Button11
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "+")
Case $Button12
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "-")
Case $Button13
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "*")
Case $Button14
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "/")
Case $Button15
GUICtrlSetData($Input1, Execute(GUICtrlRead($Input1)))
Case $Button16
GUICtrlSetData($Input1, "")
EndSwitch
WEnd
[/cs]
Edit: habs geändert mit include (unwichtige) drausen!
Edit²: hab noch gemacht das man nur 1x " . " machen kann