how to do a document completed void to a web browser variable?

Yairk_kaufmann 6 Reputation points
2021-03-07T05:42:38.087+00:00

I want to do a function when the browser complete to load the document but it's in variable

Developer technologies | C#
{count} votes

1 answer

Sort by: Most helpful
  1. Timon Yang-MSFT 9,606 Reputation points
    2021-03-09T02:52:50.507+00:00

    I think you should need WebBrowser.DocumentCompleted Event.

            private void Form1_Load(object sender, EventArgs e)  
            {  
                WebBrowser WebBrowser = new WebBrowser();  
                WebBrowser.DocumentCompleted += WebBrowser_DocumentCompleted;  
            }  
      
            private void WebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)  
            {  
               //do your function  
            }  
    

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.