WebBrowser in C# (VS.NET Start Page)

  • Thread starter Noah Coad [MVP .NET/C#]
  • Start date
N

Noah Coad [MVP .NET/C#]

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#]
 
S

Stefano \WildHeart\ Lanzavecchia

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

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

andrew lowe

Noah Coad said:
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?

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
 

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