Jump to content

Inputbox() Button change


Go to solution Solved by funkey,

Recommended Posts

Posted

Hello,

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
        ExitLoop
    Else
        $filename = $NewFilename
        $savedir = @ScriptDir&"\"&$filename
    EndIf
WEnd

Any ideas are appreciated

:)

Posted

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
GUISetState()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        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, "")
    EndSwitch
WEnd

Snips & Scripts

  Reveal hidden contents

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

 

  • Solution
Posted

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.

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
  • Recently Browsing   0 members

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