Cancel BButton bei Inputbox

  • Tag zusammen,

    ich habe folgendes Problem: Wie kann ich bei einer Inputbox den Cancel-Button dem Exit zuweisen? Oder könnte der Cancel-Button sogar weggelassen werden? So, wie bei einer Msgbox?

    mfG
    Charlie Steiner

    Einmal editiert, zuletzt von Charlie (27. Juli 2009 um 18:18)

  • Versteh grad nicht so recht, wo dein Problem ist ..

    Mal das Beispiel aus der Hilfe:

    Spoiler anzeigen
    [autoit]

    ;Places the input box in the top left corner displaying the characters as they
    ;are typed.
    $answer = InputBox("Question", "Where were you born?", "Planet Earth", "", _
    -1, -1, 0, 0)

    [/autoit] [autoit][/autoit] [autoit]

    ;Asks the user to enter a password. Don't forget to validate it!
    $passwd = InputBox("Security Check", "Enter your password.", "", "*")

    [/autoit] [autoit][/autoit] [autoit]

    ;Asks the user to enter a 1 or 2 character response. The M in the password
    ;field indicates that blank string are not accepted and the 2 indicates that the
    ;responce will be at most 2 characters long.
    $value = InputBox("Testing", "Enter the 1 or 2 character code.", "", " M2")

    [/autoit]

    hulle

  • Also mit einer MsgBox kann ich das ja so machen:

    [autoit]

    $Msgbox = MsgBox(1,"","Hallo")
    If $Msgbox = 2 Then
    Exit
    Endif
    MsgBox(0,"","Bye")

    [/autoit]

    Aber wie mache ich das mit einer Inputbox? Wenn ichs mit der Inputbox so mache schliesst sich die Box wenn ich 2 eintippe.

  • so? ?(

    Spoiler anzeigen
    [autoit]

    $Inputbox = InputBox("", "Hallo")
    If @error = 1 Then
    Exit
    Else
    MsgBox(0,"","Bye")
    EndIf

    [/autoit]

    hulle


  • Hallo
    Das hier funktioniert bei mir nicht. in meine Variable wir auch kein @ERROR Flag übergeben

    Code
    $INPUT1 = InputBox("lol", "Zeile 1")
    If @Error = 1 then ;hier wird geprüft ob abbrechen gedrückt wurde
    	MsgBox(0,"Abbrechen","Du hast abbrechen gedrückt")
    	Exit
    Endif
    
    
    	MsgBox(0,"OK","Du hast OK gedrückt")