1. 程式人生 > >c#的webbrowser常用屬性方法總結

c#的webbrowser常用屬性方法總結

//載入一個空白頁面
webBrowser1.Navigate("about:blank");
//設定webbrowser可編輯,需要webbrowser提前Navigate一個頁面
//方法一
mshtml.IHTMLDocument2 doc =webBrowser1.Document.DomDocument as mshtml.IHTMLDocument2;
doc.designMode = "on";//on 編輯模式;off 瀏覽模式
//方法二
webBrowser1.Document.ExecCommand("EditMode", false, null);
webBrowser1.Document.ExecCommand("LiveResize", false, null);