Results 1 to 2 of 2

Thread: How do I expose the LoadCompleted method in the WebBrowser class in WPF C#?

  1. #1
    Join Date
    Oct 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How do I expose the LoadCompleted method in the WebBrowser class in WPF C#?

    How do I expose the LoadCompleted method in the WebBrowser class in WPF C#?

    I am trying to write a C# program in wpf that retrieves the content of a web page.

    The first thing I tried was to try the WebRequest and WebResponse classes. This did not provide the actual displayed content. WebResponse reveils the HTML code that is sent to the browser. But I discovered that, while the page is being loaded by the browser, javascript can change what content is finally displayed in the browser.

    So I decided to use the WebBrowser class.

    Immediately I found that there are two WebBrowser classes. Thee is the one that is documented for WinForms and there is another that is documented for WPF. I need to understand the one documented for WPF. What I think I neeed to know what to do is to retrieve code after the "LoadCompleted" method is caused. But I do not know how to this and I cannot find any example demonstrating how this is done.

    I think I have this much"
    Code:
         WebBrowser webbrowser1;
    
         webbrowser1 = new WebBrowser();
    
         webbrowser1.LoadCompleted +=webbrowser1_LoadCompleted;
    But I want to know what the method, webbrowser1_LoadCompleted, would be or look like..

  2. #2
    Join Date
    May 2012
    Location
    Moscow, Russia
    Posts
    661
    Mentioned
    35 Post(s)
    Quoted
    102 Post(s)

    Default

    Per aspera ad Astra!
    ----------------------------------------
    Slow and steady wins the race.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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