timfulcher Posted July 18, 2007 Share Posted July 18, 2007 Hi Just downloaded the program and looks really good - nice to create boxes, buttons, labels etc on GUI Windows However - I am new to all this windows GUI stuff as I used to program in Standard BASIC with line numbers etc Can someone give me a clue as to the code All I want to do is get started with the code you need to enter some number in a text box, and then when you click the button, the result is displayed in another text box I produced a GUI looking like this ------------------------- #include <GUIConstants.au3> GUICreate("Simple Calculator", 300, 150) GUICtrlCreateInput( "Enter", 25, 25, 50, 20) GUICtrlCreateButton( "Calculate", 100, 25, 75, 20) GUICtrlCreateInput( "= Answer", 200, 25, 50, 20) GUISetState (@SW_SHOW) ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend ------------------------------- But - obviously this doesnt actually DO anything Anyone give me a clue as to how to make the button take the input from first box - say times it by 5, and put answer in 2nd box Would be grateful - thanks Link to comment Share on other sites More sharing options...
mrbond007 Posted July 18, 2007 Share Posted July 18, 2007 (edited) #include <GUIConstants.au3> GUICreate("Simple Calculator", 300, 150) $inp1 = GUICtrlCreateInput( "Enter", 25, 25, 50, 20) $but1 = GUICtrlCreateButton( "Calculate", 100, 25, 75, 20) $inp2 = GUICtrlCreateInput( "= Answer", 200, 25, 50, 20) GUISetState (@SW_SHOW); will display an empty dialog box While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $but1 Then GUICtrlSetData($inp2, GUICtrlRead($inp1)^5) Wend Edited July 18, 2007 by mrbond007 Projects : Space Regain - Memory Fusion - PWGT - Chip-ITGames : BrainPain - BrainPain Director's Cut - ProSpeed Games Pack (New)Vista vs XP : the forbidden fight Link to comment Share on other sites More sharing options...
timfulcher Posted July 18, 2007 Author Share Posted July 18, 2007 Thanks - now I can see where Im going Would you know if there are any code snippets anywhere on the forum for anything Thanks Link to comment Share on other sites More sharing options...
mrbond007 Posted July 20, 2007 Share Posted July 20, 2007 Thanks - now I can see where Im goingWould you know if there are any code snippets anywhere on the forum for anythingThanksYou will find codes scattered around in the "General Help and Support" forum. You just have to search for them, but it won't be that easy. Projects : Space Regain - Memory Fusion - PWGT - Chip-ITGames : BrainPain - BrainPain Director's Cut - ProSpeed Games Pack (New)Vista vs XP : the forbidden fight 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