Jump to content
Sign in to follow this  
dina

Automating C# Windows Forms

Recommended Posts

dina

Hi all,

I am new using AutoIT. I have found it very simple and easy to automate the windows applications. Now I am trying to automate a C# Windows form. I just need to pass a value to a text box in the window. When tried to get the name of the textbox through the AutoIT Window Info Tool, I got the class name as "WindowsForms10.EDIT.app4" and the instance is 1. Could anyone please help me on this?

Regards,

Dina.

Share this post


Link to post
Share on other sites
PsaltyDS

Hi all,

I am new using AutoIT. I have found it very simple and easy to automate the windows applications. Now I am trying to automate a C# Windows form. I just need to pass a value to a text box in the window. When tried to get the name of the textbox through the AutoIT Window Info Tool, I got the class name as "WindowsForms10.EDIT.app4" and the instance is 1. Could anyone please help me on this?

Regards,

Dina.

Look up ControlSetText() in the help file. Use the advanced format to specify the ControlID:

$sNewText = "This is new text."
$hWin = WinGetHandle("Window Title", "Window Text")
ControlSetText($hWin, "", "[CLASS:WindowsForms10.EDIT.app4; INSTANCE:1]", $sNewText)

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
dina

Look up ControlSetText() in the help file. Use the advanced format to specify the ControlID:

$sNewText = "This is new text."
$hWin = WinGetHandle("Window Title", "Window Text")
ControlSetText($hWin, "", "[CLASS:WindowsForms10.EDIT.app4; INSTANCE:1]", $sNewText)

:)

Thank you so much! I got it worked.

Regards,

Dina.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.