Posted: Sat Aug 30, 2008 7:28 pm Post subject: [Help] Pressing button programatically
I'm in the need of knowing how to press a button on a webpage(which i have opened in a webbroser control) using code. Any help is appreciated.
Im coding in C# btw. _________________
Never confuse activity with productivity. You can be busy without a purpose, but what's the point?- Rick Warren
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
Posted: Sat Aug 30, 2008 8:14 pm Post subject:
Frostbyt3 wrote:
If you can keep pressing tab till you get to the button, try this when the document has finished loading
Code:
SendKeys.Send("{TAB}"); //Repeat as many times as needed
SendKeys.Send("{ENTER}"); //Presses enter on the button
SendKeys.SendWait() is preferred over SendKeys.Send() because the latter doesn't allow the control/window to process the key before going on; sometimes certain keys simply don't register when you use it because it's overloaded with keys. _________________
Open the link the button opens when u press it?
Tab all the way to it?
Set the mouse pos to it and click?
I think the first suggestion would be prefferable in my case( the last would be near impossible). It'll be in the HTML source code of the site right?
Thanks alot for the replies.
Edit It seems that the button calls a function when pressed
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum