Jump to content

Help again with guictrlsetdata


Recommended Posts

Ok, now I have another problem..

I have this script (this is not all)

$1 = "Username"
$2 = "Password"
$input = guictrlcreateinput ($1, 10,10)
$button = guictrlcreatebutton ("button",50,50)

while 1
$msg = guigetmsg ()
select
case $msg = $button
  $variable = guictrlread ($1)
  XXXX
endselect
wend

I know I did not typed it all correctly. Where is XXXX i want to insert guictrlsetdata, so $1 will receive $2. What is the code for that?

Edited by Nephentes
Link to comment
Share on other sites

Ok. Sorry, I typed it really wrong...

$1 = "Username"

$2 = "Password"

$input = guictrlcreateinput ($1, 10,10)

$button = guictrlcreatebutton ("button",50,50)

while 1

$msg = guigetmsg ()

select

case $msg = $button

$variable = guictrlread ($1)

guictrlsetdata

endselect

wend

When the button is pressed, the text from $1 (Username) will become Password (what it is in $2) and the input box will display "Password"

Link to comment
Share on other sites

How is this ?

#include <GUIConstantsEx.au3>

$1 = "Username"
$2 = "Password"

GUICreate("Title goes here") 
$input = guictrlcreateinput ($1, 10,10)
$button = guictrlcreatebutton ("button",50,50)
GUISetState()

while 1
    $msg = guigetmsg ()
    select
        case $msg = $button
            $1 = GUICtrlRead($input)
            GUICtrlSetData($input, $2)
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    endselect
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...