Jump to content

Inputbox() Button change


Go to solution Solved by funkey,

Recommended Posts

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

:)

Link to comment
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
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


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

 

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...