Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / December 2004

Tip: Looking for answers? Try searching our database.

Closing form with WebBrowser control causes app to close

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
moondaddy - 16 Dec 2004 16:38 GMT
I have a vb.net 1.1 winforms app and am using a WebBrowser control
(AxSHDocVw.AxWebBrowser) on it.  When I close the form the entire
application closes.  This behavior didn't happen until I added the
WebBrowser control.  Actually, the WebBrowser (WB) control is on a User
Control nested on another user control like this:

Form1
   Main User Control (an open a number of different user controls depending
on the function we want to perform)
       Control with WB.

In the dispose event of the Main User Control  I set the reference to ucWB
to nothing hoping this would help, but it made no difference.

Can someone explain what's happening here and how to resolve it?

Thanks.

Signature

moondaddy@nospam.com

Tom Krueger [MSFT] - 17 Dec 2004 20:01 GMT
First off, is the form that you are closing the form that contains the
Main().  In other words is it the entry point for the application.  I know
you said the behavior wasn't happening before adding the Web Browser
control, however, I just want to make sure.

The only thing that pops into my head is that there is some exception
occuring.  Does the process actually end (use Task Manager to find out)

As far as setting the object reference to null, that won't kick off the
garbage collection.  You will want to try calling Dispose on the browser
control first.  However, I don't think this will help.  Have you tried
making a small sample application with the same structure.  What if you
don't use the user control and just put the web browser control on the form?

Post more info and I will try to help.

Best of luck,

Signature

Tom Krueger

Smart Client DevCenter - http://msdn.microsoft.com/smartclient/
Mobile DevCenter - http://msdn.microsoft.com/mobility

This posting is provided "as is" with no warranties and confers no rights.

>I have a vb.net 1.1 winforms app and am using a WebBrowser control
>(AxSHDocVw.AxWebBrowser) on it.  When I close the form the entire
[quoted text clipped - 13 lines]
>
> Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.