views:

1416

answers:

1

I am using vs2008 and I would like to disable image loading on my webbrowser control but I dont see any solution except for the WebBrowserEX which doesn't seem outside of .net 1.1.

Anyone know how to do this? Thanks!

A: 

you should replace its tag , give the following code a try

var html = webBrowser.DocumentText;
var newOne = Regex.Replace(html, "<img.*/>", "", RegexOptions.Multiline);
webBrowser.DocumentText = newOne;
Adinochestva
Yeah this doesn't work. There is no place to cleanly replace the image tags.
What do u mean there is no place ? have you tried above code ? whats wrong with it ?
Adinochestva
Yeah I tried actually. I placed this code in the NavigateCompleted event but the page isn't fully loaded yet so it doesn't work there. I dont want to put it in the DocumentCompleted event because by then the images are already loaded. The whole point is my trying to speed up the DocumentComplete process by skipping the images. So yeah I haven't had any success with this code, have you tried to use it before? Where in the Webbrowser life cycle do you place it?