zoukankan      html  css  js  c++  java
  • Webbrowser在鼠标选中的地方插入文本

    using  System;
    using  System.Collections.Generic;
    using  System.ComponentModel;
    using  System.Data;
    using  System.Drawing;
    using  System.Text;
    using  System.Windows.Forms;
    using  mshtml;

    // 添加引用 .Net-Microsoft.mshtml
    namespace  WindowsApplication29
    {
        
    public   partial   class  Form1 : Form
        
    {
            
    public  Form1()
            
    {
                InitializeComponent();
                
    this .webBrowser1.Navigate( " www.google.cn " );
            }


            
    private   void  button1_Click( object  sender, EventArgs e)
            
    {
                IHTMLDocument2 doc 
    =  (IHTMLDocument2) this .webBrowser1.Document.DomDocument;
                IHTMLTxtRange range 
    =  doc.selection.createRange()  as  IHTMLTxtRange;
                range.pasteHTML(range.text
    + " <div>jinjazz 路过</div> " );
            }

        }

    }
     
  • 相关阅读:
    String类的常用方法
    StringBuffer和String的区别
    docker安装kali
    6.找素数
    5.三羊献瑞
    4.迷宫大逃亡
    3.百米
    2.后台登录
    1.猴子吃桃
    深入理解Docker容器和镜像
  • 原文地址:https://www.cnblogs.com/cl1024cl/p/6204966.html
Copyright © 2011-2022 走看看