webBrowser.Document.Write() Irregular Performance

后端 未结 2 1847
Happy的楠姐
Happy的楠姐 2021-01-27 23:39

I am using a webBrowser control as the main output window for my application. The first time I use document.write(), the text is completely replaced. The second time the text

相关标签:
2条回答
  • 2021-01-28 00:18

    If that doesn't work for you here is another alternative,

    webBrowser1.DocumentText = "<HTML><BODY>I am Vinod Srivastav</BODY></HTML>";
    

    which sets the HTML contents of the page displayed in the WebBrowser control.

    0 讨论(0)
  • 2021-01-28 00:22

    Call OpenNew before writing the document.

    HtmlDocument doc = webBrowser1.Document.OpenNew(true);
    doc.Write("<HTML><BODY>This is a new HTML document.</BODY></HTML>");
    
    0 讨论(0)
提交回复
热议问题