Sign in to follow this  
Followers 0
EliTe_ThuT

ControlSetText

5 posts in this topic

Hey,

I would like to know how we can send "enter" to an edit control. I'm using this to send new text to display in another window

ControlSetText("Window", "", "Edit1", $text)

But the text is all on one line...how can we send line breaks??

Thx

Share this post


Link to post
Share on other sites



I am under the impression that ControlSetText changes the text in the title of a window. Meaning you /cant/ add breaks.

I don't know what an 'edit control' is, so I don't know what you're talking about, so I probably don't know what I'm talking about.


Share this post


Link to post
Share on other sites

,,,...how can we send line breaks??...

$text2set = "This is sample text to be sent to notepad." & @CRLF & _
        "This is a second line to be set." & @CRLF & _
        "...and a third line."

Run("notepad")
WinWait("Untitled - Notepad")
WinActivate("Untitled - Notepad")
WinWaitActive("Untitled - Notepad")

ControlSetText("Untitled - Notepad", "", "Edit1", $text2set)

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

Share this post


Link to post
Share on other sites

I am under the impression that ControlSetText changes the text in the title of a window...

That is done with WinSetTitle ().

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

Share this post


Link to post
Share on other sites

$text2set = "This is sample text to be sent to notepad." & @CRLF & _
        "This is a second line to be set." & @CRLF & _
        "...and a third line."

Run("notepad")
WinWait("Untitled - Notepad")
WinActivate("Untitled - Notepad")
WinWaitActive("Untitled - Notepad")

ControlSetText("Untitled - Notepad", "", "Edit1", $text2set)
lol....thx...I had tryed @CR and @LF but not @CRLF... :)

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