Results 1 to 4 of 4

Thread: VS 2005 VB.NET : Web Browser Help Needed

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Location
    malaysia
    Posts
    89

    Unhappy VS 2005 VB.NET : Web Browser Help Needed

    Hi guys i am having a window form, within the form, i have 2 part,
    the upper part is a datagridview and the lower part is a web browser (control name :wbBroser).

    the situation is this:
    when i double click a cell on the datagridview, the web browser will display a web page content, which is working fine.

    the code to navigate:
    wbBroser.Navigate(strURL)

    however, when i click close button which is in the web page, it will prompt out a message :
    The web page you are viewing is trying to close the window
    do you want to close the window?
    yes no

    after i click the yes, then the web browser become blank again.

    However, when i try to double click a cell in datagridview to launch web browser to view other page, it come out the following error.
    COMException was unhandle.
    Error HRESULT E_FAIL has been returned from a call to a COM Object.


    can anyone tell me how to solve this error?
    Attached Images Attached Images  

  2. #2
    New Member
    Join Date
    Sep 2005
    Location
    York, PA (work in Baltimore, MD)
    Posts
    5

    Re: VS 2005 VB.NET : Web Browser Help Needed

    Were you able to solve this error? If so, can you let us know (I've had a similar problem in the past)?

    Thanks,
    Josh Lindenmuth

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: VS 2005 VB.NET : Web Browser Help Needed

    I am not positive on this one, but use the webbrowser controls WindowClosing event.

    when the event fires (I am thinking it should when you click that close button in the webpage) you can set the e.cancel event arg to true to cancel the closing.. then just navigate via code to about:blank to blank out the page. This should keep the handle alive to the webbrowser, and allow you to navigate again without the error.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Location
    malaysia
    Posts
    89

    Re: VS 2005 VB.NET : Web Browser Help Needed

    thanks for the idea sharing.
    i would give it a try

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