【发布时间】:2018-03-20 14:25:43
【问题描述】:
我正在使用 webbrowser 控件来显示在我的程序中创建并作为 XMLdocument 保存在公共变量中的 SVG 文件。现在我想编辑我的 SVG 并在 webbrowser 控件中加载新文件。
这是我正在使用的变量
Public XSchemaSVG As New XmlDocument
当我填充它并将其加载到我的网络浏览器中时,一切正常,然后当我想要更新版本时,我使用以下代码重新加载 SVG
Public Sub DrawSVGinWebBrowserControl()
Dim text As String = XSchemaSVG.InnerXml
WebBrowser1.DocumentText = "<!DOCTYPE HTML><html><head><meta http-equiv=""x-ua-compatible"" content=""IE=11""><meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8""><title>SVG overzicht</title> </head><body>" & text & "</body></html>"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'Clear XSchemaSVG
XSchemaSVG.RemoveAll()
'Draw new SVG in XSchemaSVG
DrawOverzichtSVG()
'load new SVG in webbrowser control
DrawSVGinWebBrowserControl()
End Sub
但是浏览器控件中的图片并没有改变。我认为这与我清除 XMLdocument 的方式或我在 webbrowser 控件中加载它的方式有关,任何人都可以在这里帮助我并告诉我我做错了什么吗?以及如何解决?
编辑:所以我检查并确认我的 XMLdocument 正在更新。所以问题在于重新加载 webbrowser 控件。
【问题讨论】:
标签: xml vb.net svg webbrowser-control