I am writing a simple personal app that has a browser control and I want it to automatically "Refresh" gmail to check it more often than it does by default. There are monkey scripts that do this but I'm trying to add my personal style to it.
Anyhow, I've looked around and found everything but what I can do in csharp using the browser control.
I found this:
C#
// Link the ID from the web form to the Button var
theButton = webBrowser_Gmail.Document.GetElementById("Refresh");
// Now do the actual click.
theButton.InvokeMember("click");But it comes back with null in 'theButton' so it doesn't invoke anything.
Anyone have any suggestions?
Thanks again!

Suthish NairRank #92 · 22.8K reputationPosted Mar 28, 2011, 10:35 AM EDT
webBrowser_Gmail.document.getElementById("Refresh").click();
or directly
document.getElementById("Refresh").click();
eric martin32 reputationPosted Mar 28, 2011, 10:55 AM EDT
error CS0079: The event 'System.Windows.Forms.HtmlElement.Click' can only appear on the left hand side of += or -=
Sam HobbsRank #107 · 20.5K reputationPosted Mar 28, 2011, 6:33 PM EDT
Please show us at least the line of code that causes the error.