Jump to content
Sign in to follow this  

Inputbox() Button change

Recommended Posts



is there a way to replace button caption from "Cancel" to "Replace" in the inputbox?

Local $filename = "Address.txt"
Local $savedir = @ScriptDir&"\"&$filename

While FileExists($savedir) 

    Local $NewFilename = InputBox($savedir, 'The File: "'& $filename &'" already exists, please enter new filename or press cancel to overwrite: ', $filename)
    If @Error = 1 Then
        $filename = $NewFilename
        $savedir = @ScriptDir&"\"&$filename

Any ideas are appreciated


Share this post

Link to post
Share on other sites

Why not just make your own? :)

#include <GUIConstants.au3>

Global $hWnd, $msg, $input, $bOkay, $bReplace

$hWnd = GUICreate("InputBox", 200, 140) ; create the window
$input = GUICtrlCreateInput("", 15, 25, 160) ; create the input
$bOkay = GUICtrlCreateButton("Okay", 15, 80) ; create the okay button
$bReplace = GUICtrlCreateButton("Replace", 125, 80) ; create the replace button

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
        Case $bOkay
            ; tell us what we entered
            MsgBox(0, "", GUICtrlRead($input))
        Case $bReplace
            ; this is just a sample it does not have to do with how you want to actually
            ; use the replace button
            GUICtrlSetData($input, "")

Snips & Scripts

My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ


Share this post

Link to post
Share on other sites

  • Like 1

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.