Posted by Catur Nugroho | File under :

Autoit Control Set Text Using C#

Sets text of a control.
ControlSetText ( "title", "text", controlID, "new text" [, flag] )

Parameters

title The title of the window to access.
text The text of the window to access.
controlID The control to interact with. See Controls.
new text The new text to be set into the control.
flag [optional] when different from 0 (default) will force the target window to be redrawn.

Return Value

Success: Returns 1.
Failure: Returns 0 if window/control is not found.

Remarks

None.

Source : Autoit Help Document

Source Code Autoit Control Set Text In C#



Parameters Required :
Title : [CLASS:Notepad]
Text : ""
Control : Edit1

private void controlSetTextButton_Click(object sender, EventArgs e)
        {
            //open notepad program
            autoit.Run("notepad.exe", "", 1);

            //wait notepad opened until 10 seconds
            autoit.WinWait("[CLASS:Notepad]", "", 10);

            //set the text
            autoit.ControlSetText("[CLASS:Notepad]", "", "Edit1", "autoitsourcecode.blogspot.com");
        }


Download Full Source Code

0 comments:

Post a Comment