views:

1852

answers:

2

In C# WinForms, what's the proper way to get the backward/forward history stacks for the System.Windows.Forms.WebBrowser?

A: 

It doesn't look like it's possible.

My suggestion would be to catch the Navigated event and maintain your own list. A possible problem with that is when the user clicks back in the browser, you don't know to unwind the stack.

nickd
Surely it's possible using the native mshtml.
Judah Himango
Maybe. What do you mean?
nickd
I mean, there's gotta be a way to get it using the underlying IE ActiveX control.
Judah Himango
+3  A: 

Hey Judah! Check out http://www.bsalsa.com/downloads.html. This is a series of Delphi components (free source code, you can see an example of this here: http://staruml.cvs.sourceforge.net/staruml/staruml/staruml/components/plastic-components/src/embeddedwb.pas?revision=1.1&view=markup - it's the starUML projects code) and they have, among other things, a way to get at the history, favorites, etc using the IE MSHTML interfaces. It's written in Object Pascal but it shouldn't be too hard to figure out what's going on. If you download the "Embedded Web Browser Components Package" take a look at the stuff in EmbeddedWB_D2005\Source - there's all sorts of goodies there.

Jim Crafton