PC Review


Reply
Thread Tools Rate Thread

Closing form with WebBrowser control causes app to close

 
 
moondaddy
Guest
Posts: n/a
 
      16th Dec 2004
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.


--
(E-Mail Removed)


 
Reply With Quote
 
 
 
 
Tom Krueger [MSFT]
Guest
Posts: n/a
 
      17th Dec 2004
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,

--
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.

"moondaddy" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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.
>
>
> --
> (E-Mail Removed)
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
webbrowser control: how to capture event of mouse hovering over thelink or mouse click events in webbrowser only? P-GPS Microsoft VB .NET 1 15th Dec 2007 12:31 PM
Screen capture control using WebBrowser control and GDI+ in a web app JP2006 Microsoft ASP .NET 1 7th Jan 2007 08:51 PM
Showing form , closing login form but not closing app, how Bob Microsoft VB .NET 3 21st Dec 2005 08:54 PM
Closing event in a MID Child form I don't know if the child form is closing or the main form is closing **Developer** Microsoft C# .NET 1 19th Oct 2005 04:51 PM
app closing, closing one app from within another? ray well Microsoft VB .NET 0 4th Nov 2003 12:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:49 PM.