none
WebBrowser如何选中网页内容的一段文字? RRS feed

  • 问题

  • 用webBrowser打开一个网页,比如这篇帖子。

    如何模拟鼠标选中指定开始文字到指定结束文字中的内容并复制呢?

    比如当前页,选中从“主页”到“搜索论坛:”这之间的文字?

    注意:是模拟鼠标选中文字,不是获取HTML代码。

    2011年3月23日 18:13

答案

全部回复

  • 参考http://support.microsoft.com/kb/293125,把需要执行的命令从copy改为select



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    2011年3月23日 22:21
    版主
  • 参考http://support.microsoft.com/kb/293125,把需要执行的命令从copy改为select



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    他这个是获得网页中的某个元素,如何添加一个范围是一段文字开始到令一段文字结束?
    2011年3月30日 7:50
  • 创建一个TextRange之后用MoveStart和MoveEnd更改range的范围,再对TextRange执行选择命令。

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    2011年3月30日 16:16
    版主