FMS Posted April 8, 2011 Share Posted April 8, 2011 Dear reader, I'm a little stuck in a script i'm building and hope someone can help me whit this. For the most people i think this is a easy script but i'm new to this so plz read to the noobisch script This button needs to generate a number from the diffrence of input 1 and 2 and put it in input 3.. And put the outcomming number on top of input field 4 and 5 in this case is it : 100 - 80 = 20 --> put 20 in input field 3 read input field 4 and put field 3 on top of it.. : 300 + 20 = 320 put this in input field 6 read input field 5 and put field 3 on top of it.. : 200 + 20 = 220 put this in input field 7 The thing is that the user can only fill in field 1,2,4 and 5 and the generator fills in 3,6 and 7 thnx in advanced expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 280, 270, 192, 114) $Label1 = GUICtrlCreateLabel("label1", 8, 15, 74, 25) $Label2 = GUICtrlCreateLabel("label2", 8, 45, 74, 25) $Label3 = GUICtrlCreateLabel("label3", 8, 75, 74, 25) $Label4 = GUICtrlCreateLabel("label4", 8, 105, 74, 25) $Label5 = GUICtrlCreateLabel("label5", 8, 135, 74, 25) $Label6 = GUICtrlCreateLabel("label6", 8, 165, 74, 25) $Label7 = GUICtrlCreateLabel("label7", 8, 195, 74, 25) $Input1 = GUICtrlCreateInput("100", 120, 10, 145, 21) $Input2 = GUICtrlCreateInput("80", 120, 40, 145, 21) $Input3 = GUICtrlCreateInput("20", 120, 70, 145, 21) $Input4 = GUICtrlCreateInput("300", 120, 100, 145, 21) $Input5 = GUICtrlCreateInput("200", 120, 130, 145, 21) $Input6 = GUICtrlCreateInput("320", 120, 160, 145, 21) $Input7 = GUICtrlCreateInput("220", 120, 190, 145, 21) $Button1 = GUICtrlCreateButton("Cancel", 24, 230, 97, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("Generate", 147, 230, 97, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Exit Case $Button2 ;~ This button needs to generate a number from the diffrence of input 1 and 2 and put it in input 3.. ;~ And put the outcomming number on top of input field 4 and 5 ;~ in this case is it : 100 - 80 = 20 --> put it in input field 3 ;~ read input field 4 and put field 3 on top of it.. : 300 + 20 = 320 ;~ read input field 5 and put field 3 on top of it.. : 200 + 20 = 220 ;~ The thing is that the user can only fill in field 1,2,4 and 5 and the generator fills in 3,6 and 7 Exit EndSwitch WEnd as finishing touch god created the dutch Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 8, 2011 Share Posted April 8, 2011 I haven't pasted the whole code, just what needs to be added/changed. Case $Button2 ;~ This button needs to generate a number from the diffrence of input 1 and 2 and put it in input 3.. ;~ And put the outcomming number on top of input field 4 and 5 ;~ in this case is it : 100 - 80 = 20 --> put it in input field 3 ;~ read input field 4 and put field 3 on top of it.. : 300 + 20 = 320 ;~ read input field 5 and put field 3 on top of it.. : 200 + 20 = 220 ;~ The thing is that the user can only fill in field 1,2,4 and 5 and the generator fills in 3,6 and 7 GUICtrlSetData($Input3, GUICtrlRead($Input1) - GUICtrlRead($Input2)) GUICtrlSetData($Input4, GUICtrlRead($Input4) + GUICtrlRead($Input3)) GUICtrlSetData($Input5, GUICtrlRead($Input5) + GUICtrlRead($Input3)) ;Exit - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
AutoBert Posted April 8, 2011 Share Posted April 8, 2011 Hello FMS, why don't trying yourself? You need GiCtrlRead for Reading Inpt-Controls and GuiCtrlSetData for writib int Controls. with GUICtrlSetState($put3,$Gui_Disable)yo can disallow User to change values in a Input-Control Link to comment Share on other sites More sharing options...
FMS Posted April 11, 2011 Author Share Posted April 11, 2011 i've treid it autobert but get a little stuck thats why i put a post on this forum i was proud of myself when the GUI was working lol as finishing touch god created the dutch Link to comment Share on other sites More sharing options...
FMS Posted April 11, 2011 Author Share Posted April 11, 2011 @somdcomputerguy thnx just what i needed en uiteindelijk achteraf ziet het er allenmaal zo simpel uit as finishing touch god created the dutch 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