WinFrom下Webbrowser加载自定义页面的技巧
生活随笔
收集整理的這篇文章主要介紹了
WinFrom下Webbrowser加载自定义页面的技巧
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
先使用Navigate("about:balnk")方法,打開一個(gè)空頁(yè)面,實(shí)際內(nèi)容在IE_DocumentCompleted中寫入。代碼來(lái)源于csdnreader程序。
private System.Windows.Forms.WebBrowser IE; private string currentHtml; private void ShowHtml(string html) {currentHtml=html;//打開一個(gè)空白頁(yè),實(shí)際內(nèi)容在IE_DocumentCompleted中this.IE.Navigate("about:balnk"); } private void IE_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) {//顯示內(nèi)容if (e.Url.ToString() == "about:balnk"){this.IE.Document.Write(CurrentHtml);} }轉(zhuǎn)載于:https://www.cnblogs.com/yczz/p/3894269.html
總結(jié)
以上是生活随笔為你收集整理的WinFrom下Webbrowser加载自定义页面的技巧的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: (王道408考研操作系统)第三章内存管理
- 下一篇: 计算机网络之网络层:7、距离向量算法RI