Is there a way to emulate typing in text input box?

Add-in Express™ Support Service
That's what is more important than anything else

Is there a way to emulate typing in text input box?
 
Mike McNamee




Posts: 2
Joined: 2017-03-01
Is there a way to emulate typing on the keyboard when filling out some forms in a web application? I've built a toolbar that has a button that fills out textboxes on a webpage form. I can set the values in the textboxes and combo boxes, but a few of them in the app have some code behind that does input validation. Those controls don't "accept" the inputs without clicking on the control with the mouse, which is a bit of a pain. I thought if rather than just setting the value of the controls, there was a way to emulate typing the text into them. Any help or suggestions would be appreciated.

Thanks,
Mike
Posted 01 Mar, 2017 18:44:04 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Hello Mike,

Check if SendKeys.Send works for you:
- https://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send(v=vs.110).aspx

I suppose you will need to set the focus on a control, probably wait a little - you use a System.Windows.Forms.Timer or the SendMessage/OnSendMessage machinery that we describe in section Messaging; see the PDF file in the folder {Add-in Express}\Docs on your development PC - and finally call SendKeys.Send().

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 02 Mar, 2017 02:28:11 Top
Mike McNamee




Posts: 2
Joined: 2017-03-01
Thanks for the suggestions Andrei. I'll check them out.
Mike
Posted 03 Mar, 2017 18:33:46 Top