Groups | Blog | Home
all groups > c# > july 2003 >

c# : WebBrowser in C# (VS.NET Start Page)


Noah Coad [MVP .NET/C#]
7/31/2003 10:28:52 PM
How does one gain access to the WebBrowser (SHDocVw) control to the extent
of the one used in VS.NET Start Page?

I'm familiar with using the control directly, I've written a tutorial on it,
and am familiar with HTML Applications (HTA), but how are features like the
right-click context sensitive menu and selection diabled in VS.NET's Start
Page?

If I attempt to make a WebBrowser control navigate to an HTA file, it brings
up a dialog asking whether to open or save the file, how do I get it to
directly open imediately in the browser?

Is there any word on when/if a .NET WebBrowser host will be released?

WebBrowser Reference:
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/reflist_vb.asp

My Web Content Tutorial:
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=312

-Noah Coad
Microsoft MVP & MCP [.NET/C#]

Stefano \
8/1/2003 12:56:07 PM
[quoted text, click to view]

The much talked about
http://msdn.microsoft.com/vstudio/productinfo/roadmap.aspx contains the
sentences:
"Second, Windows Forms will include features and controls that increase
developer productivity. These include: an Active Document Container for
hosting Office documents, a Microsoft Office-style toolbar, intuitive
splitter controls, a sound component that can run in partial trust, a Web
browser control that can be accessed safely by way of managed code, and
layout controls that automatically position and resize controls on a form as
screen resolution or form dimensions change."

If it turns into reality Whidbey will quickly become my best friend...
--
WildHeart'2k3

andrew lowe
8/4/2003 9:21:04 AM

[quoted text, click to view]

Noah,

If you want to control things like the context menu of the webbrowser you'll
have write a class to implement the IDocHostUIHandler. Once that is done you
can then cast webbrowsers Document property to ICustomDoc and call the
SetUIHandler method. The IDocHostUIHandler interface has a method called
ShowContextMenu and you can disable the showing of the menu in your
implementation of this method

hth
andrew


Noah Coad [MVP .NET/C#]
8/9/2003 10:51:08 AM
Just the thing I was looking for, thanks!!!

-Noah


[quoted text, click to view]

AddThis Social Bookmark Button