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 |
|
Andrei Smolin
Add-in Express team
Posts: 18825
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().
Andrei Smolin
Add-in Express Team Leader |
|
Mike McNamee
Posts: 2
Joined: 2017-03-01
|
Thanks for the suggestions Andrei. I'll check them out.
Mike |
|