CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2008
    Posts
    6

    [RESOLVED] Creating WebBrowser Runtime

    I want to parse HTML using HtmlDocument. If I do this
    Code:
     
    webBrowser = new WebBrowser(); 
    webBrowser.Navigate(inputFile);
    it is not enough to properly load the Document member (webBrowser.Document.Body == null). However, it works when the control is placed on a form (which tells me the webBrowser instance will require some more setup).

    Please note: I'd like to create the control in runtime - this done in a class library.

  2. #2
    Join Date
    Feb 2008
    Posts
    6

    Re: Creating WebBrowser Runtime

    Everything works OK but I needed to add DoEvents.

    Code:
    webBrowser.Navigate(inputFile);
    Application.DoEvents();
    It seems that Navigate spawns a thread and I now force it to complete.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured