Welcome to MSDN Blogs Sign in | Join | Help

Lester's WPF blog


Simple, easy & beautiful

News

WPF WebBrowser (.NET 3.5 SP1)

One of the new controls is the WebBrowser... aha!! not the Winforms control.. we now have it in WPF.

Functions supported by this control are:

  • NavigateToString
  • NavigateToStream
  • Navigate
  • GoBack
  • GoForward

 In xaml it would look like something like this:

<StackPanel Name="panel">

  <WebBrowser Height="500"  >

  </WebBrowser>

</StackPanel>

 

 

 

I put together a simple sample which tries to use this functionality Looks like the above. Nothing fancy :)

Also since this is beta you might find a few rough edges (bugs) here and there.Please report them on the connect website or on the forums. 

Project Code: Attached

Share this post

 

Posted: Thursday, June 12, 2008 1:28 PM by llester
Filed under: ,

Attachment(s): WebBrowser.zip

Comments

Mark said:

Ooh, nice. Yet another barrier to WPF adoption gone.

Any rumours on whether this control will be in Silverlight 2.0?

# June 12, 2008 12:28 PM

commenter said:

That's just cheating - you can't rotate it!

# June 12, 2008 1:26 PM

reality-refactored said:

WPF Browser Control, Crossbow?

# June 12, 2008 2:29 PM

Michael said:

When loading your solution i get the following error message:

Error 1 The tag 'WebBrowser' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'. Line 7 Position 6. D:\WebBrowser\WebBrowser\adhoc\Window1.xaml 7 6 adhoc

# June 12, 2008 6:17 PM

llester said:

you need to have.Net 3.5 SP1 to be installed on your machine

# June 13, 2008 1:47 AM

Christopher Steen said:

ASP.NET Disabling a User Interface Element During a Partial Page Postback [Via: 4 Guys from Rolla ]...

# June 13, 2008 6:47 AM

HolaMan said:

it's still handle-based window.

not pure WPF visual control

# June 13, 2008 2:26 PM

Graham said:

Damn, that was what I feared. I guess whatever bits of IE they are running under the covers are hard to unshackle from this mode of operation. I would be great if this stuff could get rendered into a WPF visual off-screen, so that it would render properly. I'd imagine that would make all the input interaction hard to do though.

# June 13, 2008 2:41 PM

Graham said:

on that note, I wonder how difficult it would be to make a compliant html rendering engine using wpf. I wonder if anyone has started this project?

# June 13, 2008 2:43 PM

Ed Blacker said:

Can you set the http user-agent?

Can you pass in an object for scripting so that javascript can call functions on it via windows.external?

# June 16, 2008 7:52 AM

Christopher Steen said:

MSBuild MSBuild Reserved Properties [Via: Sayed Ibrahim Hashimi ] Sharepoint Adding Copy and Paste...

# June 19, 2008 12:04 AM

Johannes said:

Hallo

That’s really cool but for us without SP1 we must still use the frame. Is it possible to load HTML into a document viewer or some other control that allow you to zoom the content?

# July 16, 2008 8:10 AM

dinesh said:

how can i set the title of the page i navigate to as my webbrowser header...i can get it by webBrowser.AxIWebBrowser2.LocationName...but AxiWebBrowser2 is not a public member hence not able to access it...any ideas??

# July 25, 2008 6:08 AM

Everything about Microsoft .NET & Enterprise Servers said:

.NET 3.5 SP1 中新增了一个新的 WebBrowser 控件用于 WPF 应用中。以后在 WPF 程序中就不要用以前的 WinForm WebBrowser 了,直接在XAML中写&lt;WebBrowser&gt;标签即可。

# July 30, 2008 8:02 AM

Joycode@Ab110.com said:

【SharePoint】: SharePoint (MOSS) 2007 有了一个 SharePoint Online 服务了。这个是 Microsoft Online Services 的一部分,也是微软的&#8220;Everything

# August 17, 2008 6:39 AM
New Comments to this post are disabled
Page view tracker