Two Questions concerning the WebBrowser Control

F

frederik12

Hi all,

Today I downloaded and installed VS 2005 C# Express Edition (.NET
framework 2.0). I'm very pleased about this new product.

In my current application I'm using the WebBrowser control in a child
form. Two questions:

1) Does the user need IE to get this control working?
2) I cancel the closing of the child form in it's FormClosing event and
hide the form instead because of frequent navigation request coming
from the parent form. But I'm a bit confused/concerned with the help I
found on MSDN concerning the WebBrowser control: "Be sure to call the
Dispose method when you are finished using the control to ensure that
all resources are released in a timely fashion. You must call the
Dispose method on the same thread that attached the events, which
should always be the message or user-interface (UI) thread." I do not
want to spill memory on an end-user's machine. So my question: do I
need to call - and if so where - the Dispose method somewhere in my
parent/child form?

Thanks in advance for your time,
Frederik
 
J

Jean-Philippe Gouigoux \(MGDIS\)

Hi,

To answer your first question, yes, IE is needed. In fact, the WebBrowser
component in .NET 2.0 is still a wrap-up of Internet Explorer, though it is
a much more advanced one than in .NET 1.1. It now does not use the COM
interface, but directly the IE APIs. But still, it is IE behind.

For your second question, I would say you should not call the finalizer, as
you just want to prevent the form from being seen, but it should keep it in
memory. Doing so would offset the benefits of your technique.

Cheers,

JP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top