Finchsize
Finchsize

Reputation: 935

Webbrowser forButton click and set text of TextBox

I'm programming in WPF/C# VS2012/2010. I was trying to make an application where you can click on a button to login to an account. The very first webbrowser i used was C# System.Windows.Forms.WebBrowser.

It was fine all methods was nice and simple to use:

Browser.Document.GetElementById("Email").SetAttribute("value", "xxx");
Browser.Document.GetElementById("signin").InvokeMember("Click");

or

HtmlElementCollection textArea = Browser.Document.GetElementsByTagName("textarea");
foreach (HtmlElement element in textArea)
{
    if (element != null)
    {
        element.Focus();
        element.InnerText = "Very nice :]";
    }
}

This webbrowser is very simple to use, but it is not good enough: it crashed, doesn't use Active-X, HTML5, Silverlight, and much more... So the next one I was trying to use it was "Awensomium".

This is a good webbrowser, no crashes and can easily use all that things I described above, but it's not so simple to use, it doesn't have methods to click buttons, or anything and I can't figure out how I can do this.

Do you know some webbrowser search engine for WPF/C# that allows me to click button etc... and using Active-X,HTML5 and other technologies?

Upvotes: 1

Views: 1507

Answers (1)

stratever
stratever

Reputation: 596

If you are developing in WPF, you shuld use System.Windows.Controls.WebBrowser instead of Forms.WebBrowser. It uses your installed instance of Internet Explorer, so features depend on your IE version. If you upgrade to IE9 you'll be able to show and handle html5,css3 .. items. But if you like Awesomium, then you should try this: http://wpfchromium.codeplex.com/ (there are some examples also) .

Upvotes: 2

Related Questions