views:

28

answers:

1

I am building some kind of eBook reader in C# and have the following problem. Rendering HTML in the WebBrowser control just works fine. However, I want to be able to mark text samples with the mouse. This should be available via a button event or (even better) by click-and-drag directly onto the text. How can I get the feedback of the mouse events in the WebControl (and also the selected text)? Are there any examples around?

In a further step I want toe be able to insert notes as well (maybe by HTML injection)

I tried to get it to work with the WebControl, but had not a lot of success. Maybe some of you know a different approach (Gecko, Webkit?).

+1  A: 

You already have DOM of the document loaded, and all you need to mark the samples is to modify the the source using DOM. DOM is, roughly speaking is a tree, that represents html source of WebBrowser control.

See IHTMLDocument2 . It's all not so complicated..

Dmitry Karpezo
You can make arbitrary changes (I've done this to update relative links to point to the actual web site when caching the page locally).
Richard