简体   繁体   English

如何从.NET WebBrowser控件获取反馈/交互?

[英]How can I get feedback/interaction from the .NET WebBrowser control?

I am building some kind of eBook reader in C# and have the following problem. 我正在C#中构建某种电子书阅读器,并且遇到以下问题。 Rendering HTML in the WebBrowser control just works fine. 在WebBrowser控件中呈现HTML效果很好。 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)? 如何获得WebControl中鼠标事件的反馈(以及所选文本)? Are there any examples around? 周围有什么例子吗?

In a further step I want toe be able to insert notes as well (maybe by HTML injection) 在进一步的步骤中,我希望脚趾也能够插入注释(也许通过HTML注入)

I tried to get it to work with the WebControl, but had not a lot of success. 我试图使其与WebControl一起使用,但是并没有取得很大的成功。 Maybe some of you know a different approach (Gecko, Webkit?). 也许有些人知道其他方法(Gecko,Webkit?)。

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,并且标记示例所需的只是使用DOM修改源。 DOM is, roughly speaking is a tree, that represents html source of WebBrowser control. DOM大致来说是一棵树,代表WebBrowser控件的html源。

See IHTMLDocument2 . 参见IHTMLDocument2 It's all not so complicated.. 都没那么复杂..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM