anyday Posted March 20, 2006 Share Posted March 20, 2006 Here is my question, i have a simple gui made with scite. all i have is an input box asking for a policy number and when the person hit's submit button i need to gui to close and then insert the $Input_2 into a form element. i can do all but i dont know how to make it close the gui when the person hits submit button? Here is the gui code. #region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.6 Prototype #include <GuiConstants.au3> GuiCreate("MyGUI", 331, 125,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Label_1 = GuiCtrlCreateLabel("Please Enter Policy Number", 20, 10, 220, 20) $Input_2 = GuiCtrlCreateInput("", 20, 50, 230, 30) $Button_3 = GuiCtrlCreateButton("Submit", 80, 100, 130, 20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit #endregion --- GuiBuilder generated code End --- Link to comment Share on other sites More sharing options...
Geert Posted March 20, 2006 Share Posted March 20, 2006 #include <GuiConstants.au3> GUICreate("MyGUI", 331, 125, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Label_1 = GUICtrlCreateLabel("Please Enter Policy Number", 20, 10, 220, 20) $Input_2 = GUICtrlCreateInput("", 20, 50, 230, 30) $Button_3 = GUICtrlCreateButton("Submit", 80, 100, 130, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_3 $PolicyNumber=GUICtrlRead($Input_2) ExitLoop Case Else ;;; EndSelect WEnd MsgBox(64,"Policy Number Entered",$PolicyNumber) Exit Link to comment Share on other sites More sharing options...
anyday Posted March 20, 2006 Author Share Posted March 20, 2006 thanks for the help, now the only problem im having is the script exits after the msg box and i need it to keep going Link to comment Share on other sites More sharing options...
Geert Posted March 20, 2006 Share Posted March 20, 2006 #include <GuiConstants.au3> GUICreate("MyGUI", 331, 125, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Label_1 = GUICtrlCreateLabel("Please Enter Policy Number", 20, 10, 220, 20) $Input_2 = GUICtrlCreateInput("", 20, 50, 230, 30) $Button_3 = GUICtrlCreateButton("Submit", 80, 100, 130, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_3 $PolicyNumber=GUICtrlRead($Input_2) GUIDelete() MsgBox(64,"Policy Number Entered",$PolicyNumber) Case Else ;;; EndSelect ToolTip("Script is running in loop") WEnd Exit Link to comment Share on other sites More sharing options...
anyday Posted March 20, 2006 Author Share Posted March 20, 2006 Well that helped thanks, atleast the script does not stop but here is my code #include <GuiConstants.au3> GUICreate("MyGUI", 331, 125, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Label_1 = GUICtrlCreateLabel("Please Enter Policy Number", 20, 10, 220, 20) $Input_2 = GUICtrlCreateInput("", 20, 50, 230, 30) $Button_3 = GUICtrlCreateButton("Submit", 80, 100, 130, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_3 $PolicyNumber=GUICtrlRead($Input_2) GUIDelete() MsgBox(64,"Policy Number Entered",$PolicyNumber) Case Else ;;; EndSelect ToolTip("Script is running in loop") WEnd Exit $n = 14 $s = 23 Send ("{Tab "& $n & "}") Send ("{Enter}") ControlSetText ("OnBase 4,3,7,68", "", "Edit2", $Input_2 ) after i hit submit on the gui it does not do any thing following it. do i have it in the wrong position? Link to comment Share on other sites More sharing options...
GaryFrost Posted March 21, 2006 Share Posted March 21, 2006 take Exit out SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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