Click here to Skip to main content
Rate this: bad
good
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,

AlSayed
Posted 13-Jun-12 0:22am

1 solution

Rate this: bad
good
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.
  Permalink  
Comments
Abed AlSayed at 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 at 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
0 Sergey Alexandrovich Kryukov 399
1 Nirav Prabtani 338
2 Abhinav S 170
3 PIEBALDconsult 160
4 Dave Kreskowiak 155
0 OriginalGriff 7,580
1 Sergey Alexandrovich Kryukov 6,806
2 Maciej Los 3,919
3 Peter Leow 3,693
4 CHill60 2,742


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 13 Jun 2012
Copyright © CodeProject, 1999-2014
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