Ich stell dann mal meinen 1. funktionierenden Taschenrechner Public ![]()
Sogar diesmal mit Funktion ![]()
Bei dem Script wurde mir etwas geholfen von L3viathan . Thx.
Hier die Source :
[autoit]#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Taschenrechner create by volle", 154, 254, 303, 187)
$Button1 = GUICtrlCreateButton("7", 16, 96, 25, 25, 0)
$Button4 = GUICtrlCreateButton("3", 80, 160, 25, 25, 0)
$Button5 = GUICtrlCreateButton("5", 48, 128, 25, 25, 0)
$Button6 = GUICtrlCreateButton("*", 112, 96, 25, 25, 0)
$Button7 = GUICtrlCreateButton("=", 80, 192, 25, 25, 0)
$Button9 = GUICtrlCreateButton("+", 112, 192, 25, 25, 0)
$Button11 = GUICtrlCreateButton("AC", 16, 56, 25, 25, 0)
$Button12 = GUICtrlCreateButton("2", 48, 160, 25, 25, 0)
$Button13 = GUICtrlCreateButton("6", 80, 128, 25, 25, 0)
$Button15 = GUICtrlCreateButton("4", 16, 128, 25, 25, 0)
$Button17 = GUICtrlCreateButton("1", 16, 160, 25, 25, 0)
$Button18 = GUICtrlCreateButton("-", 112, 160, 25, 25, 0)
$Button19 = GUICtrlCreateButton("/", 112, 128, 25, 25, 0)
$Button20 = GUICtrlCreateButton("8", 48, 96, 25, 25, 0)
$Button21 = GUICtrlCreateButton("9", 80, 96, 25, 25, 0)
$Button22 = GUICtrlCreateButton(".", 48, 192, 25, 25, 0)
$Button24 = GUICtrlCreateButton("0", 16, 192, 25, 25, 0)
$Input1 = GUICtrlCreateInput("", 8, 16, 137, 21)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "7")
Case $Button4
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "3")
Case $Button5
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "5")
Case $Button6
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "*")
Case $Button7
GUICtrlSetData($Input1, Execute(GUICtrlRead($Input1)));;;
Case $Button9
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "+")
Case $Button11;;;
GUICtrlSetData($Input1, "")
Case $Button12
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "2")
Case $Button13
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "6")
Case $Button15
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "4")
Case $Button17
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "1")
Case $Button18
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "-")
Case $Button19
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "/")
Case $Button20
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "8")
Case $Button21
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "9")
Case $Button22
GUICtrlSetData($Input1, GUICtrlRead($Input1) & ".")
Case $Button24
GUICtrlSetData($Input1, GUICtrlRead($Input1) & "0")
EndSwitch
WEnd
//Edit: Ich hab jetzt das alte Source rausgenommen und das neue eingesetzt ![]()
Beim alten Script hatte auch die AC Taste nicht funktioniert wie vielleicht auch manche mit bekommen hatten.
Mit freundlichen Grüßen
volle ![]()
P.S.: Kritik und Lob ist auch erwünscht ![]()