问题
I want to set up inline content of a WPF WebBrowser control:
<WebBrowser>
<html>
<body><b>Inline content.</b></body>
</html>
</WebBrowser>
Or alternatively:
Dim wb As New WebBrowser
wb.Content = "<html><body><b>Programmatic content</b></body></html>"
回答1:
Call NavigateToString or NavigateToStream:
wb.NavigateToString("<html><body><b>Programmatic content</b></body></html>");
Yeah, they are badly named.
来源:https://stackoverflow.com/questions/1598030/set-system-windows-controls-webbrowsers-content-to-a-static-html-literal