KuljeetSingh.com

Feb 14, 2013

Activate Edit Mode in WebBrowser Control (VB.NET)

Web browser control is basically used to navigate the web pages. But it also provide the functionality to customize the content. For e.g. If we want to create an Emailer wherein we want to apply styles to our content and send the Email programmically then WebBrowser Control allow us to Edit / Create the content, after which we can view it's HTML and send it as HTML body in our Email program. We can also implement customized HTML Editor with this functionality. By default, design mode of the WebBrowser Control is set to Off. I found two methods for setting WebControl's design mode to On.

First Method is using the mshtml library.
For e.g.
Import mshtml ' Import mshtml library at the top.

Dim doc As IHTMLDocument2
doc = DirectCast(webBrowser1.Document.DomDocument, mshtml.IHTMLDocument2)
doc.designMode = "On"


This above example required to add mshtml library in project. Usually mshtml is installed with .NET framework
You can found / copy the library in "C:\Program Files\Microsoft.NET\Primary Interop Assemblies" to install the assembly.

Second Method is rather easy. I found it here
Dim axObj As New Object
axObj = WebBrowser1.ActiveXInstance
axObj.document.designmode = "On"    ' Intellisense won't be available for this.

Hope, it may be useful.

 
?

Blogs | About Me | My Projects | Contact Me
【丰胸】虽然,这些药物对于乳房而言粉嫩公主,能够起到一定的丰胸效果,可朋友们这些药物的后遗症,也会在我们服完后慢慢显现出来丰胸产品,譬如:机体中的雌激素水平被打破了,就容易导致我们的月经变得不正常丰胸食物,从而使得我们的腰跟着变得圆嘟嘟,而严重的话还可能会导致我们的子宫出血,肝脏受损丰胸效果,所以说若是采用药物来进行丰胸,大家还是小心谨慎些为好。