【问题标题】:Set System.Windows.Controls.WebBrowser's content to a static HTML literal?将 System.Windows.Controls.WebBrowser 的内容设置为静态 HTML 文字?
【发布时间】:2009-10-21 00:08:03
【问题描述】:

我想设置 WPF WebBrowser 控件的内联内容:

<WebBrowser>
    <html>
        <body><b>Inline content.</b></body>
    </html>
</WebBrowser>

或者:

Dim wb As New WebBrowser
wb.Content = "<html><body><b>Programmatic content</b></body></html>"

【问题讨论】:

    标签: html wpf webbrowser-control .net-3.5


    【解决方案1】:

    致电NavigateToString 或 NavigateToStream:

    wb.NavigateToString("<html><body><b>Programmatic content</b></body></html>");
    

    是的,他们的名字很糟糕。

    【讨论】:

    • 名字不好是什么意思?关于“NavigateToString”方法名称?如果是,我同意。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-13
    • 1970-01-01
    • 1970-01-01
    • 2013-01-30
    • 2013-05-06
    • 2013-04-22
    相关资源
    最近更新 更多