Doug Williams
New member
- Joined
- May 20, 2010
- Messages
- 4
- Programming Experience
- 10+
I keep reading and seeing C# examples of how to make webbrowser control (v2.0 .NET) editable (i.e. user can edit the text displayed in the webbrowser control).
I found this VB example but it causes an error:
Dim axObj As New Object
axObj = WebBrowser1.ActiveXInstance
axObj.document.designmode = "On"
I found this C# example but it also errors:
w1.Document.DomDocument.GetType().GetProperty("designMode").SetValue(w1.Document.DomDocument, "On", null);
NOTE: the "null" at the end is not liked by VB but the rest can be typed and everything shows in drop downs as periods (.) are typed - so it appears to be valid objects / syntax. I ended up having to fix the problem with "null" as follows:
Dim arr(0) as Object
arr(0) = DBNull.Value
w1.Document.DomDocument.GetType().GetProperty("designMode").SetValue(w1.Document.DomDocument, "On", arr)
When run, I get an error:
"#2147221595 Object reference not set to an instance of an object"
Any ideas hot to make webbrowser a control that can be used to edit HTML?
I found this VB example but it causes an error:
Dim axObj As New Object
axObj = WebBrowser1.ActiveXInstance
axObj.document.designmode = "On"
I found this C# example but it also errors:
w1.Document.DomDocument.GetType().GetProperty("designMode").SetValue(w1.Document.DomDocument, "On", null);
NOTE: the "null" at the end is not liked by VB but the rest can be typed and everything shows in drop downs as periods (.) are typed - so it appears to be valid objects / syntax. I ended up having to fix the problem with "null" as follows:
Dim arr(0) as Object
arr(0) = DBNull.Value
w1.Document.DomDocument.GetType().GetProperty("designMode").SetValue(w1.Document.DomDocument, "On", arr)
When run, I get an error:
"#2147221595 Object reference not set to an instance of an object"
Any ideas hot to make webbrowser a control that can be used to edit HTML?