WebBrowser created dynamically doesn't work

Posted by Maciej on Stack Overflow See other posts from Stack Overflow or by Maciej
Published on 2010-04-07T07:50:26Z Indexed on 2010/04/07 7:53 UTC
Read the original article Hit count: 347

I'd like to create WebBrowser control programically in my code and then read page content.
I think I'm doing the same thing as designer does but control dynamically created doesn't work (DocumentText return empty string)

What I'm doing wrong ??

WebBrowser browser = new WebBrowser { Name = "myBrowser"};
browser.Navigate("www.google.com");
Console.WriteLine(browser.DocumentText);

© Stack Overflow or respective owner

Related posts about winforms

Related posts about controls