plam4o Posted February 1, 2013 Share Posted February 1, 2013 How to multiply two inputbox and show result in third? I want to put number in inputGo and inputP and when i pres the button result shows in inputG. Thank you. #include #include Global $v $Form2 = GUICreate("SSS", 290, 220, 312, 159) $InputGo = GUICtrlCreateInput("", 8, 20, 65, 21) $Label1 = GUICtrlCreateLabel("Go", 128, 24, 26, 17) $InputP = GUICtrlCreateInput("", 105, 167, 73, 21) $Label4 = GUICtrlCreateLabel("P", 117, 150, 54, 17) $InputG = GUICtrlCreateInput("", 216, 20, 65, 21) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateGroup("", -99, -99, 1, 1) $ButtonCalc = GUICtrlCreateButton("Calculate", 104, 190, 75, 25) GUICtrlSetOnEvent($ButtonCalc, "_Calculate") GUISetState(@SW_SHOW) Func _Calculate() $InputG = Execute($InputGo*$InputP) EndFunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ButtonCalc $v = Execute($InputGo*$InputP) EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 1, 2013 Moderators Share Posted February 1, 2013 (edited) Hi, plam4o, welcome to the forum. Have a look at GuiCtrlRead, and GuiCtrlSetData in the help file. You would basically do something like this (play around with it to get the result you're looking for): GUICtrlSetData = GuiCtrlRead("field 1") x GuiCtrlRead("field 2"). Edited February 1, 2013 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
plam4o Posted February 1, 2013 Author Share Posted February 1, 2013 (edited) Thank you. Finally get it. You have a beer from me. Edited February 1, 2013 by plam4o Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now