PC Review


Reply
Thread Tools Rate Thread

Disable loading of images in WebBrowser control

 
 
Jeff Caton
Guest
Posts: n/a
 
      10th Jun 2010
Hello!
How can I disable loading images in the webbrowser control?
 
Reply With Quote
 
 
 
 
Onur Güzel
Guest
Posts: n/a
 
      10th Jun 2010
On Jun 10, 10:06 am, Jeff Caton <j.ca...@gmailnotspam.com> wrote:
> Hello!
> How can I disable loading images in the webbrowser control?


There's no built-in method or property do disable images from being
loaded in webbrowser control which relies on IE. And modifying "src"
attribute of "img" tag may not be enough as the images may come from
dynamically from different servers. So, another solution can be
tweaking registry to disable images from being loaded, note that this
setting also effects regular Internet Explorer. So, you may re-set it
to False as follows:

' Set Display Inline Images value to false
Dim regkey As Microsoft.Win32.RegistryKey = _
My.Computer.Registry.CurrentUser
regkey.OpenSubKey("Software\Microsoft\Internet Explorer\Main", _
True).SetValue("Display Inline Images", "no")

Keep in mind that writing to registry requires administrative rights.

HTH,

Onur Güzel
 
Reply With Quote
 
Onur Güzel
Guest
Posts: n/a
 
      10th Jun 2010
On Jun 10, 6:11 pm, "redbull" <redb...@libero.it> wrote:
> "Onur Güzel" <kimiraikkone...@gmail.com> ha scritto nel messaggionews:2c54ce94-24a0-40e6-acce-(E-Mail Removed)...
>
> > On Jun 10, 10:06 am, Jeff Caton <j.ca...@gmailnotspam.com> wrote:
> >> Hello!
> >> How can I disable loading images in the webbrowser control?

>
> what about a 2 pass procedure?
> u load the html page using webclient, then you can remove all the unwanted
> tags , then you load the code into a webbrowser control


That will only work with pure-HTML. Think of a page that should
retrieve images or any visual content dynamically, that is, while page
is open, using some script. At that time, newer content than the
loaded content (content, whose img tags are removed) will bring
images. Worse, there may be other elements in document such as links
which have the non-absolute targets (hrefs), like "page.html" rather
than "http://somedomain.com/page.html". When you download a file onto
a local disk (let's say c:\), browser will try locating link's target
at: c:\page.html" which is not available.

So, disabling images using registry before launching application is
wiser to approach. Restore it on app shutdown, as well.

Onur Güzel
 
Reply With Quote
 
Jeff Caton
Guest
Posts: n/a
 
      10th Jun 2010
Thanks, Onur!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Determine When a Page Is Done Loading in WebBrowser Control =?Utf-8?B?QW1pciBL?= Microsoft C# .NET 6 27th Jul 2007 02:41 AM
Webbrowser control not loading Html string zz Microsoft Excel Programming 2 8th Jul 2007 02:24 PM
WebBrowser control problem loading inline images in Windows Mobile 5.0 and CF 2.0 vachesacree@yahoo.com Microsoft Dot NET Compact Framework 0 17th Oct 2006 11:10 AM
Cached image name for images in WebBrowser control Timmay Microsoft VB .NET 0 2nd Apr 2006 02:13 AM
'disable' for the webbrowser control =?Utf-8?B?TWlrZSBFYXRvbg==?= Microsoft VB .NET 1 10th Jun 2005 11:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:43 AM.