Thursday, June 19, 2008

Getting the Native .Net WebBrowser to ExecWB

CodeProject - Using ExecWB with the native .NET 2.0 WebBrowser control

“One of the most annoyingly interesting components within the VB.NET 2008 environment is the WebBrowser control (or class, if you prefer) that is bundled as standard. It exposes a number of common methods and properties, but lacks one of the most useful elements that can be found in the full-blown web browser (a.k.a. SHDocVw or Ieframe.dll) version, namely the ExecWB command. The following class provides a simple example of how to harness the power of ExecWB from the System.Windows.Forms.WebBrowser class.

Background

This solution came about as I researched using the WebBrowser control and stumbled into the complex world of variations on a theme. Why all of this power couldn't be harnessed in a single solution is beyond me. However, my mission is to continue simplifying a unified theory of everything (relating to the Microsoft WebBrowser).

Dim MyWeb As Object
MyWeb = Me.WebBrowser1.ActiveXInstance MyWeb.ExecWB(Exec.OLECMDID_OPTICAL_ZOOM, _ ExecOpt.OLECMDEXECOPT_DONTPROMPTUSER, 50, IntPtr.Zero)

…” [Code snip leached for my future searching]

I’m not sure if I’ve seen this explained in such an easy to understand and implement way.

No comments: