Jump to content

[SOLVED] Need little help with GUICtrlCreateInput


 Share

Recommended Posts

Hi what is wrong I can not get the password string to work example if I write test in the input field then I want to get the same password in the msg box wish someone has a solution on how I can make it work.

 

#Include <GuiKonstant.au3> 
$GUI1 = GuiCreate("Password", 245, 45,-1,-1,BitOR($WS_CAPTION, $WS_SYSMENU))
GUISetBkColor(0x005984)
GUICtrlCreateLabel('Password: ', 5, 17, 85) ; 5, 7, 85
GUICtrlSetFont(-1, 8, 700, 1, 'Verdana')
GUICtrlSetColor(-1, 0xFFFFFF)   ; Vit text

$pw = GUICtrlCreateInput("", 65, 15, 115, 15, 32 + 128) ; 90, 7, 105, 20, 32 + 128
GUICtrlSetFont(-1, 7, 400, 1, 'Verdana')
GUICtrlSetColor(-1, 0x000000)   ; Svart Text

$Ja = GUICtrlCreateButton("Ok",193, 14, 40, 18) 
 GUICtrlSetFont(-1, 8, 400, 2, "Verdana")
 
$Nej = GUICtrlCreateButton("Nej", 193,14,40,18)
 ;GUICtrlSetFont(-1, 9, 400, 2, "Verdana")
 GUISetState()
 
$Nej = GUICtrlCreateButton("", 193,14,40,18)
 ;GUICtrlSetFont(-1, 9, 400, 2, "Verdana")
 GUISetState()
$pw1 = GUICtrlRead($pw)

While 1
        
    $nMsg = GUIGetMsg()
    
    If $nmsg = $Ja then
            exitloop
        else
             If $nmsg = $Nej then
                GUIDelete($GUI)
                                  
                  Exit
                       endif
                                endif
                 Switch $nMsg
                   Case $GUI_EVENT_CLOSE
                       
                       GUIDelete($GUI1)
                                               
                       Exit
              EndSwitch
          WEnd
          
          MsgBox(4096, "Password is " , $pw1)

 

Edited by Borje
Link to comment
Share on other sites

#include <GUIConstants.au3>

$GUI1 = GUICreate("Password", 245, 45, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU))
GUISetBkColor(0x005984)
GUICtrlCreateLabel('Password: ', 5, 17, 85) ; 5, 7, 85
GUICtrlSetFont(-1, 8, 700, 1, 'Verdana')
GUICtrlSetColor(-1, 0xFFFFFF)   ; Vit text

$pw = GUICtrlCreateInput("", 65, 15, 115, 15, 32 + 128) ; 90, 7, 105, 20, 32 + 128
GUICtrlSetFont(-1, 7, 400, 1, 'Verdana')
GUICtrlSetColor(-1, 0x000000)   ; Svart Text

$Ja = GUICtrlCreateButton("Ok", 193, 14, 40, 18)
GUICtrlSetFont(-1, 8, 400, 2, "Verdana")

$Nej = GUICtrlCreateButton("Nej", 193, 14, 40, 18)
;GUICtrlSetFont(-1, 9, 400, 2, "Verdana")
GUISetState()

$Nej = GUICtrlCreateButton("", 193, 14, 40, 18)
;GUICtrlSetFont(-1, 9, 400, 2, "Verdana")
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    If $nMsg = $Ja Then
        MsgBox(4096, "Password is ", GUICtrlRead($pw)) ; Read the control AFTER you typed in the password..
    Else
        If $nMsg = $Nej Then
            GUIDelete($GUI1)
            Exit
        EndIf
    EndIf
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            GUIDelete($GUI1)
            Exit
    EndSwitch
WEnd

 

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