zoukankan      html  css  js  c++  java
  • WinFrom下Webbrowser加载自定义页面的技巧

    先使用Navigate("about:balnk")方法,打开一个空页面,实际内容在IE_DocumentCompleted中写入。代码来源于csdnreader程序。

    private System.Windows.Forms.WebBrowser IE;
    private string currentHtml;
    private void ShowHtml(string html)
    {
          currentHtml=html;
          //打开一个空白页,实际内容在IE_DocumentCompleted中
          this.IE.Navigate("about:balnk");
    }
    private void IE_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
          //显示内容
          if (e.Url.ToString() == "about:balnk")
          {
              this.IE.Document.Write(CurrentHtml);
          }
    }
    
  • 相关阅读:
    K
    士兵队列训练问题
    分析A + B Problem II
    C++中sort()的用法
    swing初级应用创建一个窗体
    java生成随机数
    JAVA数字格式化
    CodeForces
    POJ
    51Nod
  • 原文地址:https://www.cnblogs.com/yczz/p/3894269.html
Copyright © 2011-2022 走看看