Sign in to follow this  
Followers 0
timsta97

Read input even if cancelled

2 posts in this topic

With InputBox() how can I read the user's input even if the cancel button is pushed.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

With InputBox() how can I read the user's input even if the cancel button is pushed.

You can create your own inputbox and implement this function..

Like this:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AutoIT Input Box", 288, 182, 193, 125)
$IP = GUICtrlCreateInput("", 24, 112, 217, 21)
$prompt = GUICtrlCreateLabel("", 56, 48, 4, 4)
$OK = GUICtrlCreateButton("OK", 32, 144, 73, 25, 0)
$Cancel = GUICtrlCreateButton("Cancel", 144, 145, 73, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Cancel
            MsgBox(4096,"",guictrlread($IP))
                        Exit
        Case $OK
            MsgBox(4096,"",guictrlread($IP))
    EndSwitch
WEnd
Edited by Manjish

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
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
Sign in to follow this  
Followers 0