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

    WebBrowser Click

    Hi there. I want to make this so when the webbrowser control is clicked it hides the webbrowser control. I couldnt find out where to do this at. The WebBrowser is on a Form.
    On the form it shows a website with a url picture. When it is clicked i want the webbrowser to hide. Because there are button controls behind it.

    Right now when the url WebBrowser is clicked it opens a new window of IE.
    Code:
    private: System::Void URL_Mine_DocumentCompleted(System::Object^  sender, System::Windows::Forms::WebBrowserDocumentCompletedEventArgs^  e) {
      if (URL_Mine->ReadyState == WebBrowserReadyState::Loaded)
      { if (URL_Mine->ReadyState == WebBrowserReadyState::Loading)
    	  {
      this->URL_Mine->Visible = false;
      }
    	  else
    	  {
    		 this->URL_Mine->Visible = true;
    	  }
    		 }
    		 }
    Is there something wrong with this?
    It doesnt show an error, but it doesnt work.

  2. #2
    Join Date
    Mar 2002
    Location
    Kent, United Kingdom
    Posts
    399

    Re: WebBrowser Click

    Code:
      if (URL_Mine->ReadyState == WebBrowserReadyState::Loaded) {
        if (URL_Mine->ReadyState == WebBrowserReadyState::Loading) {
          this->URL_Mine->Visible = false;
        } else {
          this->URL_Mine->Visible = true;
        }
      }
    Can ReadyState be equal to two different things at the same time ?
    your humble savant

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