Click here to Skip to main content
13,504,022 members
Rate this:
Please Sign up or sign in to vote.
Hi Iam using Visual Basic 2010 Proffisional

When I set the webbrowser (IE 9) control to editing mode, I can't change the html source code of it. for example when I add this code into button_click event :

WebBrowser1.DocumentText = "Hellooo" All document Text become nothing (Delets all things in DocumentText)

so I mean I want to open existing HTML file in editing mode, and edit it with design mode and code text too.

the code I used to set the webBrowser into Designing mode is:

Me.WebBrowser1.Document.ExecCommand("EditMode", False, Nothing)

another problem for example when I want to add link to selected text I used this code:

Me.WebBrowser1.Document.ExecCommand("CreateLink", False, Nothing)

The problem of this code is the webBrowser control its link dialog, and I want to display my custom dialog... not for insert link only, but for insert image and other dialogs...

Best Regards,

Posted 13-Jun-12 0:22am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

First, EditMode is not supported by IE (or the WebBrowser control).

As for displaying a custom dialog, you'll have to create the dialog and show it yourself to ask for the URL to insert. Executing CreateLink has nothing to do with showing the dialog.

The DefaultUserInterface parameter just tells the browser to either show the default dialog for creating the link or to show NO dialog at all. You don't get to tell it to show your dialog.
Abed AlSayed 25-Jun-12 10:10am
But the Edit Mode for WebBrowser Control is enabled by my code and I've tested it and created html web pages for it
Dave Kreskowiak 25-Jun-12 11:41am
And?? I said it wasn't supported. I didn't say it didn't work. What that means is, according to Microsoft, if you use it you're on your own. Don't expect to get support for it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.180417.1 | Last Updated 13 Jun 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100