Sign in to follow this  
Followers 0
Phantomass

GUICtrlCreateEdit incorporated text in $MyVariable

9 posts in this topic

Hello, i am a beginner in AutoIt.

My question:

In my GUI i created "GUICtrlCreateEdit", code:

GUICtrlCreateEdit("Enter text here...",5 ,105 ,180, 90)

This idle time field for entering the text...

How do I do that text which I in he entered was is my variable $MyVariable?

GUICtrlCreateEdit("$textmesarea", 5, 105, 180, 90)
- does not work :[

Show example plz...

Thank! Sorry for my bad English...

Share this post


Link to post
Share on other sites



Can you me to give the example what change variable on text which I shall enter when shall press the button?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Jos said:

#include <GUIConstants.au3>
GUICreate("Cmd",500,400)
Dim $txt=GUICtrlCreateEdit("Enter text here... Wait 5 seconds..",0,0,500,400)
GUISetState(@SW_SHOW)

enterText()

While 1
$msg=GUIGetMsg()
If $msg=$GUI_EVENT_CLOSE Then ExitLoop
WEnd

Func enterText()
Sleep(5000)
GuiCtrlSetData($txt,"Text has been entered.")
EndFunc

ETA: There are lots and lots of working code segements just like this in the helpfile. Just put your cursor on the command in scite and hit F1.

Edited by John

Share this post


Link to post
Share on other sites

I do not understand :[

Share this post


Link to post
Share on other sites

I do not understand :[

Which part is it you don't understand or is it all of it ?

Have you opened the helpfile on the provided functions and looked at the descriptions and examples ?

Would help when you are more specific. :)


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Programm copy - insert...

  • I write text for copying in clipboard, in window #1.
  • I write name a window in which me it is necessary to insert text, in window #2.
  • I press "Copy" and is copied text which I carried in window #1 ($text).
  • I press "Paste in window" and is switched on window which I carried in window #2 ($progname) & is inserted text which I have copied "Button Copy".
as?

I have done picture...

Help plz...

Posted Image

Share this post


Link to post
Share on other sites

? Is this what you're trying to do?

$hWnd = GuiCreate("")
$hEdit1 = GuiCtrlCreateEdit("",5,5,395,20)
$hEdit2 = GuiCtrlCreateEdit("",5,40,395,20)
$hButton1 = GuiCtrlCreateButton(" Copy ",5,70)
$hButton2 = GuiCtrlCreateButton("Paste in Window",50,70)

GuiSetState()

While 1
    $msg = GUIGetMsg()
    
    Switch $msg
        Case -3
            Exit
        Case $hButton1
            ClipPut(GuiCtrlRead($hEdit1))
        Case $hButton2
            WinActivate(GUICtrlRead($hEdit2))
            Send("^v{ENTER}")
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

? Is this what you're trying to do?

$hWnd = GuiCreate("")
$hEdit1 = GuiCtrlCreateEdit("",5,5,395,20)
$hEdit2 = GuiCtrlCreateEdit("",5,40,395,20)
$hButton1 = GuiCtrlCreateButton(" Copy ",5,70)
$hButton2 = GuiCtrlCreateButton("Paste in Window",50,70)

GuiSetState()

While 1
    $msg = GUIGetMsg()
    
    Switch $msg
        Case -3
            Exit
        Case $hButton1
            ClipPut(GuiCtrlRead($hEdit1))
        Case $hButton2
            WinActivate(GUICtrlRead($hEdit2))
            Send("^v{ENTER}")
    EndSwitch
WEnd
Yes! Big thanks & thanks all! :)

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