The above control embeds a RichTextBox and a couple of
buttons in a panel, and packages all that up as a UserControl
(see Source
code. It is based on code
from Devhood)
The idea of hosting Windows Forms controls into IE is
something like a Java applet embedded into a web page.
This example requires .NET
Framework v1.1 to be installed on the browser machine, and
IE5.5 as the browser. If you don't have that, you will likely
just see a big blank box up above.
how it works: In this example, the control is then loaded into the IE Browser,
but it could also be embedded into a Smart client without using
IE. Upon loading, the control tries to interrogate the CodeBase
and location of its assembly. If your security settings for IE
and .NET are typical, the control will generate and log an
exception trying to determine its location. This would be a
violation of the local filesystem access restriction, and thus
the exception. Loaded into a winforms app locally (without
download from the web and hosting in IE), the control would
correctly report its location.
Downloaded Controls are stored in the internet cache for the
particular user. You can view them by using Internet Explorer or Windows Explorer
to open %windir%\assembly\download (eg, c:\windows\assembly\download).
It will show the assemblies in the download cache.