Sign in to follow this  
Followers 0
eekhoorn12

2 inputs 1 text

7 posts in this topic

Is there a way that when I typ something in input box one it is automatic copied to input box two.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You could do... GuiCtrlRead() / GuiCtlrSetData() ... this would take you clicking a hotkey or button... maybe someone can do something with _IsPressed() for you.

Edit: Here is an example using 3 edit boxes, last one is the 1st one reversed.

#include <guiconstants.au3>
#include <string.au3>

$main = GUICreate("Blah", 220, 120)
$l1 = GUICtrlCreateInput("", 10, 10, 200, 25)
$l2 = GUICtrlCreateInput("", 10, 50, 200, 25)
$l3 = GUICtrlCreateInput("", 10, 90, 200, 25)

GUISetState()

While 1
    Sleep(10)
    $msg = GUIGetMsg()
    If $msg = -3 Then ExitLoop
    GUICtrlSetData($l2, GUICtrlRead($l1))
    GUICtrlSetData($l3, _StringReverse(GUICtrlRead($l1)))
WEnd
Edited by ronsrules

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Is there a way that when I typ something in input box one it is automatic copied to input box two.

$Answer1 = InputBox("AutoIt","First Input Box","TYPE SOMETHING NEW.","",300,100)
$Answer2 = InputBox("AutoIt","Second Input Box",$Answer1,"",500,100)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@ronsrules: nice 1, don't know what you can use this for but its really fun

i just edited a bit to make the user go crazy B)

#include <guiconstants.au3>
#include <string.au3>

$main = GUICreate("Blah", 220, 120)
$l1 = GUICtrlCreateInput("", 10, 10, 200, 25)
$l2 = GUICtrlCreateInput("", 10, 50, 200, 25)
$l3 = GUICtrlCreateInput("", 10, 90, 200, 25)

GUISetState()
$n = 0
While 1
    Sleep(10)
    $msg = GUIGetMsg()
    If $msg = -3 Then ExitLoop
    $test = guictrlread ($l1)
    $m = TimerInit()
    for $i = 1 to 150 step 1
    GUICtrlSetData($l2, GUICtrlRead($l1))
    GUICtrlSetData($l3, _StringReverse(GUICtrlRead($l1)))
Next
$n = $n + TimerDiff($m)
if $n > 1000 Then
    if $test = guictrlread($l1) then 
        GUICtrlSetData ($l1, _stringreverse(guictrlread($l1)))
    EndIf
    $n = 0
EndIf       
WEnd
Edited by Nuffilein805

Share this post


Link to post
Share on other sites

Ha!!... That's kinda neat B)

Although I think this is the last time I try to help this guy... He's pretty thanklesss!!


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Ha!!... That's kinda neat B)

Although I think this is the last time I try to help this guy... He's pretty thanklesss!!

Sorry I didn't respond that fast. I had to go to school today. But I've tried the code from Nuffelein805 but it still doesn't do what I want I need to change it a bit.

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