2 years ago
#26837
LabRat
SVG to display on button click event but how?
I have a textbox with some SVG code written in it and I would like to display it as my actual html page in a WebBrowser once the button click event is triggerd but I can see how to do that.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
TextBox1.Text = "<!DOCTYPE html><html><body><svg height=" & Chr(34) & "5000" & Chr(34) & " width=" & Chr(34) & "5000" & Chr(34) & "><g style=" & Chr(34) & "fill:none;stroke:rgb(255,0,0);stroke-width:0.1" & Chr(34) & " stroke-dasharray=" & Chr(34) & "40,5,10,5" & Chr(34) & "><line x1=" & Chr(34) & "0" & Chr(34) & " y1=" & Chr(34) & "0" & Chr(34) & " x2=" & Chr(34) & "200" & Chr(34) & " y2=" & Chr(34) & "150" & Chr(34) & "/><line x1=" & Chr(34) & "200" & Chr(34) & " y1=" & Chr(34) & "150" & Chr(34) & " x2=" & Chr(34) & "400" & Chr(34) & " y2=" & Chr(34) & "0" & Chr(34) & "/><polyline points=" & Chr(34) & "0,0 50,50 0,100 50,100 130,150 210,190" & Chr(34) & "/></g></svg></body></html>"
WebBrowser1.Document.Write(TextBox1.Text)
End Sub
vb.net
svg
textbox
webbrowser-control
0 Answers
Your Answer