Hallo mal wieder.
Wie kann ich eine Zahl aus einer InputBox mit einer festgelegten Zahl multiplizieren und das Ergebnis dann in einem Label anzeigen?
Das hier ist mein Script (was offensichtlich noch nicht fertig ist)
Aber da kommen irgendwelche Zahlen raus, nur nicht das was da eig. hinsoll Oo
Bitte schreibt mir mal wie das geht, ich verstehs einfach nicht Oo
Spoiler anzeigen
#include <GuiConstants.au3>
#include <ComboConstants.au3>
#include <GuiComboBox.au3>
#include <EditConstants.au3>
#Region ### START Koda GUI section ### Form=
$Beispiel1 = GUICreate("Beispiel", 600, 400, 150, 150)
$Label_01 = GUICtrlCreateLabel("Beispiel 1", 40, 8, 107, 22)
$Label_02 = GUICtrlCreateLabel("Beispiel 2", 340, 8, 121, 22)
$Ready1 = GUICtrlCreateButton("!Fertig!", 260, 29, 80, 30)
$Combo1 = GUICtrlCreateCombo("", 50, 30, 200, 30)
GUICtrlSetData(-1, "a|b|c|d")
$Combo2 = GUICtrlCreateCombo("", 350, 30, 200, 30)
GUICtrlSetData(-1, "a|b|c|d")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Combo1
_Info1 ()
Case $Combo2
_Info2 ()
Case $Ready1
GUISetState(@SW_HIDE, $Beispiel1)
_Beispiel1 ()
EndSwitch
WEnd
Func _Info1 ()
$Read1 = GUICtrlRead ($Combo1)
If $Read1 = "a" Then $Info_101 = GUICtrlCreateLabel("Hier Text eingeben - Beispiel a", 40, 160, 250, 220)
If $Read1 = "b" Then $Info_102 = GUICtrlCreateLabel("Hier Text eingeben - Beispiel b", 40, 160, 250, 220)
If $Read1 = "c" Then $Info_103 = GUICtrlCreateLabel("Hier Text eingeben - Beispiel c", 40, 160, 250, 220)
If $Read1 = "d" Then $Info_104 = GUICtrlCreateLabel("Hier Text eingeben - Beispiel d", 40, 160, 250, 220)
EndFunc
Func _Info2 ()
$Read2 = GUICtrlRead ($Combo2)
If $Read2 = "a" Then $Info_201 = GUICtrlCreateLabel("Hier Text eingeben - Beispiel a", 340, 160, 250, 220)
If $Read2 = "b" Then $Info_202 = GUICtrlCreateLabel("Hier Text eingeben - Beispiel b", 340, 160, 250, 220)
If $Read2 = "c" Then $Info_203 = GUICtrlCreateLabel("Hier Text eingeben - Beispiel c", 340, 160, 250, 220)
If $Read2 = "d" Then $Info_204 = GUICtrlCreateLabel("Hier Text eingeben - Beispiel d", 340, 160, 250, 220)
EndFunc
Func _Beispiel1 ()
#Region ### START Koda GUI section ### Form=
$Beispiel2 = GUICreate("Beispiel", 650, 265, 150, 150)
$Labe_03 = GUICtrlCreateLabel("Beispiel 1", 50, 30, 103, 22)
$Label_04 = GUICtrlCreateLabel("Beispiel 2", 340, 30, 115, 22)
$Ready2 = GUICtrlCreateButton("!Fertig!", 160, 224, 160, 30, 0)
[/autoit] [autoit][/autoit] [autoit]$Read3 = GUICtrlRead ($Combo1)
$Read4 = GUICtrlRead ($Combo2)
IF $Read3 = "a" Then $A_01 = GUICtrlCreateLabel("Beispiels Zahl 1", 60, 60, 100, 17)
IF $Read3 = "a" Then $A_02 = GUICtrlCreateLabel("Beispiels Zahl 2", 60, 85, 100, 17)
IF $Read3 = "a" Then $A_03 = GUICtrlCreateLabel("Beispiels Zahl 3", 60, 110, 100, 17)
IF $Read3 = "a" Then Global Const $AI_01 = GUICtrlCreateInput("0", 180, 60, 121, 21, $ES_NUMBER)
IF $Read3 = "a" Then Global Const $AI_02 = GUICtrlCreateInput("0", 180, 85, 121, 21, $ES_NUMBER)
IF $Read3 = "a" Then Global Const $AI_03 = GUICtrlCreateInput("0", 180, 110, 121, 21, $ES_NUMBER)
IF $Read3 = "b" Then $A_01 = GUICtrlCreateLabel("Beispiels Zahl 1", 60, 60, 100, 17)
IF $Read3 = "b" Then $A_02 = GUICtrlCreateLabel("Beispiels Zahl 2", 60, 85, 100, 17)
IF $Read3 = "b" Then $A_03 = GUICtrlCreateLabel("Beispiels Zahl 3", 60, 110, 100, 17)
IF $Read3 = "b" Then Global Const $AI_01 = GUICtrlCreateInput("0", 180, 60, 121, 21, $ES_NUMBER)
IF $Read3 = "b" Then Global Const $AI_02 = GUICtrlCreateInput("0", 180, 85, 121, 21, $ES_NUMBER)
IF $Read3 = "b" Then Global Const $AI_03 = GUICtrlCreateInput("0", 180, 110, 121, 21, $ES_NUMBER)
IF $Read3 = "c" Then $A_01 = GUICtrlCreateLabel("Beispiels Zahl 1", 60, 60, 100, 17)
IF $Read3 = "c" Then $A_02 = GUICtrlCreateLabel("Beispiels Zahl 2", 60, 85, 100, 17)
IF $Read3 = "c" Then $A_03 = GUICtrlCreateLabel("Beispiels Zahl 3", 60, 110, 100, 17)
IF $Read3 = "c" Then Global Const $AI_01 = GUICtrlCreateInput("0", 180, 60, 121, 21, $ES_NUMBER)
IF $Read3 = "c" Then Global Const $AI_02 = GUICtrlCreateInput("0", 180, 85, 121, 21, $ES_NUMBER)
IF $Read3 = "c" Then Global Const $AI_03 = GUICtrlCreateInput("0", 180, 110, 121, 21, $ES_NUMBER)
IF $Read3 = "d" Then $A_01 = GUICtrlCreateLabel("Beispiels Zahl 1", 60, 60, 100, 17)
IF $Read3 = "d" Then $A_02 = GUICtrlCreateLabel("Beispiels Zahl 2", 60, 85, 100, 17)
IF $Read3 = "d" Then $A_03 = GUICtrlCreateLabel("Beispiels Zahl 3", 60, 110, 100, 17)
IF $Read3 = "d" Then Global Const $AI_01 = GUICtrlCreateInput("0", 180, 60, 121, 21, $ES_NUMBER)
IF $Read3 = "d" Then Global Const $AI_02 = GUICtrlCreateInput("0", 180, 85, 121, 21, $ES_NUMBER)
IF $Read3 = "d" Then Global Const $AI_03 = GUICtrlCreateInput("0", 180, 110, 121, 21, $ES_NUMBER)
IF $Read4 = "a" Then $V_01 = GUICtrlCreateLabel("Beispiels Zahl 1", 360, 60, 100, 17)
IF $Read4 = "a" Then $V_02 = GUICtrlCreateLabel("Beispiels Zahl 2", 360, 85, 100, 17)
IF $Read4 = "a" Then $V_03 = GUICtrlCreateLabel("Beispiels Zahl 3", 360, 110, 100, 17)
IF $Read4 = "a" Then Global Const $VI_01 = GUICtrlCreateInput("0", 480, 60, 121, 21, $ES_NUMBER)
IF $Read4 = "a" Then Global Const $VI_02 = GUICtrlCreateInput("0", 480, 85, 121, 21, $ES_NUMBER)
IF $Read4 = "a" Then Global Const $VI_03 = GUICtrlCreateInput("0", 480, 110, 121, 21, $ES_NUMBER)
IF $Read4 = "b" Then $V_01 = GUICtrlCreateLabel("Beispiels Zahl 1", 360, 60, 100, 17)
IF $Read4 = "b" Then $V_02 = GUICtrlCreateLabel("Beispiels Zahl 2", 360, 85, 100, 17)
IF $Read4 = "b" Then $V_03 = GUICtrlCreateLabel("Beispiels Zahl 3", 360, 110, 100, 17)
IF $Read4 = "b" Then Global Const $VI_01 = GUICtrlCreateInput("0", 480, 60, 121, 21, $ES_NUMBER)
IF $Read4 = "b" Then Global Const $VI_02 = GUICtrlCreateInput("0", 480, 85, 121, 21, $ES_NUMBER)
IF $Read4 = "b" Then Global Const $VI_03 = GUICtrlCreateInput("0", 480, 110, 121, 21, $ES_NUMBER)
IF $Read4 = "c" Then $V_01 = GUICtrlCreateLabel("Beispiels Zahl 1", 360, 60, 100, 17)
IF $Read4 = "c" Then $V_02 = GUICtrlCreateLabel("Beispiels Zahl 2", 360, 85, 100, 17)
IF $Read4 = "c" Then $V_03 = GUICtrlCreateLabel("Beispiels Zahl 3", 360, 110, 100, 17)
IF $Read4 = "c" Then Global Const $VI_01 = GUICtrlCreateInput("0", 480, 60, 121, 21, $ES_NUMBER)
IF $Read4 = "c" Then Global Const $VI_02 = GUICtrlCreateInput("0", 480, 85, 121, 21, $ES_NUMBER)
IF $Read4 = "c" Then Global Const $VI_03 = GUICtrlCreateInput("0", 480, 110, 121, 21, $ES_NUMBER)
IF $Read4 = "d" Then $V_01 = GUICtrlCreateLabel("Beispiels Zahl 1", 360, 60, 100, 17)
IF $Read4 = "d" Then $V_02 = GUICtrlCreateLabel("Beispiels Zahl 2", 360, 85, 100, 17)
IF $Read4 = "d" Then $V_03 = GUICtrlCreateLabel("Beispiels Zahl 3", 360, 110, 100, 17)
IF $Read4 = "d" Then Global Const $VI_01 = GUICtrlCreateInput("0", 480, 60, 121, 21, $ES_NUMBER)
IF $Read4 = "d" Then Global Const $VI_02 = GUICtrlCreateInput("0", 480, 85, 121, 21, $ES_NUMBER)
IF $Read4 = "d" Then Global Const $VI_03 = GUICtrlCreateInput("0", 480, 110, 121, 21, $ES_NUMBER)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Ready2
GUISetState (@SW_HIDE, $Beispiel2)
_Ausgabe ()
EndSwitch
WEnd
EndFunc
Func _Ausgabe ()
#Region ### START Koda GUI section ### Form=
$Ausgabe = GUICreate("Beispiel", 585, 547, 243, 150)
$Label_05 = GUICtrlCreateLabel("Beispiel 1", 90, 10, 103, 22)
$Label_06 = GUICtrlCreateLabel("Beispiel 2", 370, 10, 115, 22)
$Ready3 = GUICtrlCreateButton("!Fertig!", 20, 500, 540, 30, 0)
[/autoit] [autoit][/autoit] [autoit]$Read5 = GUICtrlRead($Combo1)
Global Const $Zahl_1 = 26
Global Const $Zahl_2 = 150
Global Const $Zahl_3 = 380
IF $Read5 = "a" Then $AS_01 = GUICtrlCreateLabel($Zahl_1 * $AI_01 & " = die Zahl", 20, 45, 200, 17)
IF $Read5 = "a" Then $AS_02 = GUICtrlCreateLabel($Zahl_2 * $AI_02 & " = die Zahl", 20, 70, 200, 17)
IF $Read5 = "a" Then $AS_03 = GUICtrlCreateLabel($Zahl_3 * $AI_03 & " = die Zahl", 20, 95, 200, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Ready3
Exit
EndSwitch
WEnd
EndFunc
[/autoit]
P.S.1 : Das ist nicht das ganze Script, ich hab die unwichtigen stellen geschnitten (damits nich so lang wird ^^):D
P.S.2 : Ich hab immernoch keine Ahnung wie das mit dem AutoIt-Quellcode Button gehen soll
Edit Oscar: AutoIt-Tags hinzugefügt! Das geht genauso wie mit dem Spoiler. Alles dazwischen wird als AutoIt-Skript dargestellt.