Jump to content

password+confirm password box?


xShadowx
 Share

Recommended Posts

Sorry if this is in the wrong spot. I am wondering, im making an autoit script and I need to make a password box, then a confirm password box below it. and if the passwords dont match there will be alittle popup or a red "X" to one side. Is that possable to do, or no?

Link to comment
Share on other sites

Sorry if this is in the wrong spot. I am wondering, im making an autoit script and I need to make a password box, then a confirm password box below it. and if the passwords dont match there will be alittle popup or a red "X" to one side. Is that possable to do, or no?

yes its absolutely possible.

when the button is pressed, GuiCtrlRead both input boxes.

and when you create the input boxes, assign them to variables.

so lets say your input boxes are $InputBox1 and $InputBox2

when they press the button, you could be like

If GuiCtrlRead($InputBox1) <> GuiCtrlRead($InputBox2) ThenMsgBox(0, "", these don't match")
Link to comment
Share on other sites

Yes it is.

ex;

I used a button instead of a image :)

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


$Form1 = GUICreate("Form1", 229, 177, 193, 115)
$Input1 = GUICtrlCreateInput("Input1", 48, 40, 121, 21)
$Input2 = GUICtrlCreateInput("Input2", 48, 112, 121, 21)
$check = GUICtrlCreateButton("Button2", 72, 144, 75, 25, 0)
GUISetState(@SW_SHOW)
Global $popup

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $check
            If GUICtrlRead($Input1) = GUICtrlRead($Input2) Then
                GUICtrlDelete($popup)
                MsgBox(0, "Pass", "passwords matched!")
            Else
                $popup = GUICtrlCreateButton("", 176, 115, 11, 17, 0)
                GUICtrlSetBkColor(-1, 0xFF0000)
            EndIf
    EndSwitch
WEnd
Edited by Zisly
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...