Borje Posted April 10, 2020 Share Posted April 10, 2020 (edited) 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. expandcollapse popup#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 April 10, 2020 by Borje Link to comment Share on other sites More sharing options...
SirAlonne Posted April 10, 2020 Share Posted April 10, 2020 expandcollapse popup#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 More sharing options...
Borje Posted April 10, 2020 Author Share Posted April 10, 2020 Thank you SirAlonne that works perfect now thanks again for your help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now