Sign in to follow this  
Followers 0
Synthesis

Help again with guictrlsetdata

5 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



I don't understand , do you want to read from the input or write stuff there ?

Share this post


Link to post
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"

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0