Jump to content

Noob To Gui But I Have An Easy Question


anyday
 Share

Recommended Posts

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

#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

#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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...