Hier mein fertiger Taschenrechner. Freue mich über jede Kritik =)
Beschäftige mich aber erst seit 10 Tagen mit AutoIt. Also bitte nicht zu viele Abkürzungen verwenden
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Rechner", 366, 320, 192, 124)
GUISetBkColor(0x33CCFF)
$Label1 = GUICtrlCreateLabel("", 40, 24, 283, 36)
GUICtrlSetBkColor($Label1, 0xFFFFFF)
GUICtrlSetFont($Label1, 21)
$Button1 = GUICtrlCreateButton("1", 48, 80, 41, 41, $WS_GROUP)
GUICtrlSetBkColor($Button1, 0x0099FF)
GUICtrlSetColor($Button1, 0xFFFFFF)
$Button2 = GUICtrlCreateButton("2", 104, 80, 41, 41, $WS_GROUP)
$Button3 = GUICtrlCreateButton("3", 160, 80, 41, 41, $WS_GROUP)
GUICtrlSetBkColor($Button3, 0x0099FF)
GUICtrlSetColor($Button3, 0xFFFFFF)
$Button4 = GUICtrlCreateButton("4", 48, 136, 41, 41, $WS_GROUP)
$Button5 = GUICtrlCreateButton("5", 104, 136, 41, 41, $WS_GROUP)
GUICtrlSetBkColor($Button5, 0x0099FF)
GUICtrlSetColor($Button5, 0xFFFFFF)
$Button6 = GUICtrlCreateButton("6", 160, 136, 41, 41, $WS_GROUP)
$Button7 = GUICtrlCreateButton("7", 48, 192, 41, 41, $WS_GROUP)
GUICtrlSetBkColor($Button7, 0x0099FF)
GUICtrlSetColor($Button7, 0xFFFFFF)
$Button8 = GUICtrlCreateButton("8", 104, 192, 41, 41, $WS_GROUP)
$Button9 = GUICtrlCreateButton("9", 160, 192, 41, 41, $WS_GROUP)
GUICtrlSetBkColor($Button9, 0x0099FF)
GUICtrlSetColor($Button9, 0xFFFFFF)
$Button10 = GUICtrlCreateButton("0", 48, 248, 41, 41, $WS_GROUP)
$Button11 = GUICtrlCreateButton("/", 216, 80, 41, 41, $WS_GROUP)
$Button12 = GUICtrlCreateButton("*", 216, 136, 41, 41, $WS_GROUP)
GUICtrlSetBkColor($Button12, 0x0099FF)
GUICtrlSetColor($Button12, 0xFFFFFF)
$Button13 = GUICtrlCreateButton("-", 216, 192, 41, 41, $WS_GROUP)
$Button14 = GUICtrlCreateButton("+", 216, 248, 41, 41, $WS_GROUP)
GUICtrlSetBkColor($Button14, 0x0099FF)
GUICtrlSetColor($Button14, 0xFFFFFF)
$Button15 = GUICtrlCreateButton(".", 104, 248, 41, 41, $WS_GROUP)
GUICtrlSetBkColor($Button15, 0x0099FF)
GUICtrlSetColor($Button15, 0xFFFFFF)
$Button16 = GUICtrlCreateButton("=", 160, 248, 41, 41, $WS_GROUP)
$Button17 = GUICtrlCreateButton("C", 272, 80, 41, 41, $WS_GROUP)
GUICtrlSetBkColor($Button17, 0x0099FF)
GUICtrlSetColor($Button17, 0xFFFFFF)
$Button18 = GUICtrlCreateButton("(", 272, 136, 41, 41, $WS_GROUP)
$Button19 = GUICtrlCreateButton(")", 272, 192, 41, 41, $WS_GROUP)
GUICtrlSetBkColor($Button19, 0x0099FF)
GUICtrlSetColor($Button19, 0xFFFFFF)
$Button20 = GUICtrlCreateButton("Rücktaste", 272, 248, 82, 41, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "1")
Case $Button2
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "2")
Case $Button3
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "3")
Case $Button4
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "4")
Case $Button5
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "5")
Case $Button6
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "6")
Case $Button7
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "7")
Case $Button8
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "8")
Case $Button9
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "9")
Case $Button10
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "0")
Case $Button11
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "/")
Case $Button12
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "*")
Case $Button13
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "-")
Case $Button14
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "+")
Case $Button15
GUICtrlSetData($Label1, GUICtrlRead($Label1) & ".")
Case $Button16
GUICtrlSetData($label1, Execute(GUICtrlRead($label1)))
Case $Button17
GUICtrlSetData($Label1, "")
Case $Button18
GUICtrlSetData($Label1, GUICtrlRead($Label1) & "(")
Case $Button19
GUICtrlSetData($Label1, GUICtrlRead($Label1) & ")")
Case $Button20
$rLabel1 = GUICtrlRead($Label1)
GUICtrlSetData($Label1, StringTrimRight($rLabel1, 1))
EndSwitch
WEnd
mfG
Charlie