myspacee Posted February 20, 2008 Share Posted February 20, 2008 hello to all. i did a script that send a formatted email for my monkey users all works fine but i have few question about *while* cicle my script is composed: __________________________________________________________________________ variable declaration mask input box While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 ;################################## ; send mail ;################################## Case $msg = $Button2 ;################################## ; send mail and continue ;################################## Case $msg = $Button3 Exit EndSelect Wend my functions __________________________________________________________________________ button 1 send mail and all is ok i want that when button b is pressed all elements of my mask will be reset to null (variables, input box, date, notes, combo box) so my users can continue to use script. How can i correct my work? Thank you to all And sorry for bad english Link to comment Share on other sites More sharing options...
James Posted February 20, 2008 Share Posted February 20, 2008 While Loop is a continous ever lasting loop! You would need to use If commands etc to process. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
weaponx Posted February 20, 2008 Share Posted February 20, 2008 I can't tell what button B is but after: Case $msg = $Button1 You would use GUICtrlSetData for each form element to set it back to default. Link to comment Share on other sites More sharing options...
myspacee Posted February 20, 2008 Author Share Posted February 20, 2008 thanks for reply... any example for GUICtrlSetData and 'resetting' form? M. Link to comment Share on other sites More sharing options...
weaponx Posted February 20, 2008 Share Posted February 20, 2008 thanks for reply... any example for GUICtrlSetData and 'resetting' form? M. There is no "fun" or "magic" way of doing it like in HTML. expandcollapse popup#include <GUIConstants.au3> Dim $input1Default = "John" Dim $input2Default = "Smith" Dim $checkbox1Default = $GUI_UNCHECKED Dim $checkbox2Default = $GUI_CHECKED GUICreate("My GUI", 400, 250) ; will create a dialog box that when displayed is centered GUICtrlCreateLabel("Value 1", 10, 13) $input1 = GUICtrlCreateInput($input1Default,50, 10, 200) GUICtrlCreateLabel("Value 2", 10, 43) $input2 = GUICtrlCreateInput($input2Default,50, 40, 200) $checkbox1 = GUICtrlCreateCheckbox("Check 1", 10, 73) GUICtrlSetState (-1,$checkbox1Default) $checkbox2 = GUICtrlCreateCheckbox("Check 2", 10, 103) GUICtrlSetState (-1,$checkbox2Default) $reset = GUICtrlCreateButton("Reset", 170, 200, 60, 20) GUISetState () ; will display an empty dialog box with a combo control with focus on ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $reset GuiCtrlSetData($input1, $input1Default) GuiCtrlSetData($input2, $input2Default) GuiCtrlSetState($checkbox1, $checkbox1Default) GuiCtrlSetState($checkbox2, $checkbox2Default) EndSwitch Wend Link to comment Share on other sites More sharing options...
myspacee Posted February 21, 2008 Author Share Posted February 21, 2008 weaponx, perfect. Thank you very much. M. 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