///<summary>
/// 编辑模式
///</summary>
publicvoid EditMode()
{
if (this.webBrowser.Document!=null)
{
mshtml.IHTMLDocument2 doc =this.webBrowser.Document.DomDocumentas mshtml.IHTMLDocument2;
if (doc !=null)
{
doc.designMode ="on";
}
}
}
///<summary>
/// 启用浏览模式
///</summary>
publicvoid BrowseMode()
{
if (this.webBrowser.Document!=null)
{
mshtml.IHTMLDocument2 doc =this.webBrowser.Document.DomDocumentas mshtml.IHTMLDocument2;
if (doc !=null)
{
doc.designMode ="off";
}
}
}
///<summary>
/// 设置自动换行
///</summary>
///<param name="value"></param>
publicvoid SetAutoWrap(bool value)
{
mshtml.HTMLDocument doc =this.webBrowser.Document.DomDocumentas mshtml.HTMLDocument;
if (doc !=null)
{
mshtml.HTMLBody body = doc.body as mshtml.HTMLBody;
if (body !=null)
{
body.noWrap =!value;
}
}
}