Jump to content

How to change Input box cancel button text

Recommended Posts

Well, you could create your own inputbox, then do even more, do whatever you want.

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


Func Example()
    Opt("GUICoordMode", 2)
    GUICreate("My InputBox", 190, 114, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ; start the definition
    GUISetFont(8, -1, "Arial")
    GUICtrlCreateLabel("Prompt", 8, 7) ; add prompt info
    Local $idEdit = GUICtrlCreateInput("Default", -1, 3, 175, 20, $ES_PASSWORD) ; add the input area
    GUICtrlSetState($idEdit, $GUI_FOCUS)
    Local $idOK = GUICtrlCreateButton("OK", -1, 3, 75, 24) ; add the button that will close the GUI
    Local $idCancel = GUICtrlCreateButton("Quit", 25, -1) ; add the button that will close the GUI
    GUISetState(@SW_SHOW) ; to display the GUI

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
EndFunc   ;==>Example


Edited by careca

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples


Link to comment
Share on other sites

Thanks. Can you help me to create a custom input box for the following script by changing the Cancel button to Quit Button?

While 1
    $operation = InputBox("Title", "Choose one of the operations:" & @CRLF & "Addition (+)" & @CRLF & "Subtraction (-)" & @CRLF & "Multiple (*)" & @CRLF & "Division (/)")
    If $operation = "+" Or $operation = "-" Or $operation = "*" Or $operation = "/" Then
        MsgBox(0, "Basic Mathematics", "You Selected this Operation: " & $operation)
    ElseIf @error = 1 Then

    ElseIf  $operation <> "+" Or $operation <> "-" Or $operation <> "*" Or $operation <> "/" Or $operation = "" Then
        MsgBox(16, "Error", "The Operation Is Incorrect. Please Enter It Again.")



Edited by ramin92003
Link to comment
Share on other sites

  • Moderators

@ramin92003 careca was pretty plain with his response, what exactly did you not understand? You are limited with what you can do with the built-in InputBox (a trip through the help file would show you just what you can and cannot do). If you want to do more than this, you need to create your own. Careca also provided you with a pretty good example of how to do this, did you even try to run it?

Please note that this forum is dedicated to helping those who want to improve both their own scripts and their scripting skills; it is not a place where you put in an order and someone barfs up code for you. How about trying to modify the code careca provided you so it suits your needs? Then, if you get stuck, feel free to post back here just what you have tried, and we will do our best to assist :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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

  • Create New...