[HELP]Taschenrechner

03/09/2011 20:44 xEr0r#1
Also ich wollte nen kleinen Taschenrechner Skripten. Hab jz ein Problem.
Undzwar soll in die hinterste Inputbox der Zeile das Ergebnis angezeigt werden. Wie kann ich das machen?

Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
;----------------------------------------------------GUI---------------------------------------
$Form1 = GUICreate("Taschenrechner", 843, 507, 192, 132)
$Button1 = GUICtrlCreateButton("Rechnen", 400, 56, 209, 57, $WS_GROUP)
GUICtrlSetFont(-1, 14, 800, 0, "Mael")
$Button2 = GUICtrlCreateButton("Rechnen", 400, 144, 209, 65, $WS_GROUP)
GUICtrlSetFont(-1, 14, 800, 0, "Mael")
$Button3 = GUICtrlCreateButton("Rechnen", 400, 232, 209, 65, $WS_GROUP)
GUICtrlSetFont(-1, 14, 800, 0, "Mael")
$Button4 = GUICtrlCreateButton("Rechnen", 400, 328, 209, 65, $WS_GROUP)
GUICtrlSetFont(-1, 14, 800, 0, "Mael")
$Input3 = GUICtrlCreateInput("", 656, 72, 169, 24)
$Input2 = GUICtrlCreateInput("", 224, 72, 153, 24)
$Input1 = GUICtrlCreateInput("", 16, 72, 137, 24)
$Label1 = GUICtrlCreateLabel("   +", 160, 72, 67, 26)
GUICtrlSetFont(-1, 11, 800, 0, "Lucida Sans Unicode")
$Label2 = GUICtrlCreateLabel("   -", 160, 160, 67, 26)
GUICtrlSetFont(-1, 11, 800, 0, "Lucida Sans Unicode")
$Input4 = GUICtrlCreateInput("", 16, 160, 137, 24)
$Input5 = GUICtrlCreateInput("", 224, 160, 153, 24)
$Input6 = GUICtrlCreateInput("", 656, 168, 169, 24)
$Label3 = GUICtrlCreateLabel("   x", 160, 256, 67, 26)
GUICtrlSetFont(-1, 11, 800, 0, "Lucida Sans Unicode")
$Input8 = GUICtrlCreateInput("", 224, 256, 153, 24)
$Input7 = GUICtrlCreateInput("", 16, 256, 137, 24)
$Input9 = GUICtrlCreateInput("", 656, 256, 169, 24)
$Input10 = GUICtrlCreateInput("", 16, 344, 137, 24)
$Input11 = GUICtrlCreateInput("", 224, 344, 153, 24)
$Label4 = GUICtrlCreateLabel("   /", 160, 344, 67, 26)
GUICtrlSetFont(-1, 11, 800, 0, "Lucida Sans Unicode")
$Input12 = GUICtrlCreateInput("", 656, 352, 169, 24)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

;------------------------------------------------------------------Funktionen----------------------

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			_plus()
		Case $Button2
			_minus()
		Case $Button3
			_mal()
		Case $Button4
			_geteilt()

	EndSwitch
WEnd

Func _plus()
	$zahl1 = $Input3
	$zahl2 = $Input2
	$Input1 = $zahl1 + $zahl2
EndFunc

Func _minus()
	$zahl3 = $Input4
	$zahl4 = $Input5
	$Input6 = $zahl3 - $zahl4

EndFunc

Func _mal()
	$zahl5 = $Input8
	$zahl6 = $Input7
	$Input9 = $zahl5 * $zahl6
EndFunc

Func _geteilt()
	$zahl7 = $Input10
	$zahl8 = $Input11
	$Input12 = $zahl7 / $zahl8

EndFunc
Exit
03/09/2011 21:07 ZeraPain#2
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
;----------------------------------------------------GUI---------------------------------------
$Form1 = GUICreate("Taschenrechner", 843, 507, 192, 132)
$Button1 = GUICtrlCreateButton("Rechnen", 400, 56, 209, 57, $WS_GROUP)
GUICtrlSetFont(-1, 14, 800, 0, "Mael")
$Button2 = GUICtrlCreateButton("Rechnen", 400, 144, 209, 65, $WS_GROUP)
GUICtrlSetFont(-1, 14, 800, 0, "Mael")
$Button3 = GUICtrlCreateButton("Rechnen", 400, 232, 209, 65, $WS_GROUP)
GUICtrlSetFont(-1, 14, 800, 0, "Mael")
$Button4 = GUICtrlCreateButton("Rechnen", 400, 328, 209, 65, $WS_GROUP)
GUICtrlSetFont(-1, 14, 800, 0, "Mael")

$Input1 = GUICtrlCreateInput("", 16, 72, 137, 24)
$Input2 = GUICtrlCreateInput("", 224, 72, 153, 24)
$Input3 = GUICtrlCreateInput("", 656, 72, 169, 24)

$Label1 = GUICtrlCreateLabel("   +", 160, 72, 67, 26)
GUICtrlSetFont(-1, 11, 800, 0, "Lucida Sans Unicode")
$Label2 = GUICtrlCreateLabel("   -", 160, 160, 67, 26)
GUICtrlSetFont(-1, 11, 800, 0, "Lucida Sans Unicode")

$Input4 = GUICtrlCreateInput("", 16, 160, 137, 24)
$Input5 = GUICtrlCreateInput("", 224, 160, 153, 24)
$Input6 = GUICtrlCreateInput("", 656, 168, 169, 24)

$Label3 = GUICtrlCreateLabel("   x", 160, 256, 67, 26)
GUICtrlSetFont(-1, 11, 800, 0, "Lucida Sans Unicode")

$Input7 = GUICtrlCreateInput("", 16, 256, 137, 24)
$Input8 = GUICtrlCreateInput("", 224, 256, 153, 24)
$Input9 = GUICtrlCreateInput("", 656, 256, 169, 24)

$Input10 = GUICtrlCreateInput("", 16, 344, 137, 24)
$Input11 = GUICtrlCreateInput("", 224, 344, 153, 24)
$Input12 = GUICtrlCreateInput("", 656, 352, 169, 24)

$Label4 = GUICtrlCreateLabel("   /", 160, 344, 67, 26)
GUICtrlSetFont(-1, 11, 800, 0, "Lucida Sans Unicode")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

;------------------------------------------------------------------Funktionen----------------------

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			GUICtrlSetData($Input3, GUICtrlRead($Input1) + GUICtrlRead($Input2))
		Case $Button2
			GUICtrlSetData($Input6, GUICtrlRead($Input4) - GUICtrlRead($Input5))
		Case $Button3
			GUICtrlSetData($Input9, GUICtrlRead($Input7) * GUICtrlRead($Input8))
		Case $Button4
			GUICtrlSetData($Input12, GUICtrlRead($Input10) / GUICtrlRead($Input11))

	EndSwitch
WEnd
03/09/2011 21:24 xEr0r#3
Und wenn ich ein Multitool mache, und will, dass wenn ich auf nen button drücke, sich dieser Taschenrechner öffnet, ohne Run und Shellexecute also nur 1 Source