Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6373661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:23:24+00:00 2026-05-25T01:23:24+00:00

In a winform application I have WebBrowser control and a PictureBox . I am

  • 0

In a winform application I have WebBrowser control and a PictureBox. I am loading an Image (from webbrowser control after DocumentComplete) to pictureBox1 with the code below

IHTMLDocument2 doc = (IHTMLDocument2)webBrowser1.Document.DomDocument;
IHTMLControlRange imgRange = (IHTMLControlRange)((HTMLBody)doc.body).createControlRange();

foreach (IHTMLImgElement img in doc.images)
    {

         imgRange.add((IHTMLControlElement)img);

         imgRange.execCommand("Copy", false, null);

         pictureBox1.Bitmap = (Bitmap)Clipboard.GetDataObject().GetData(DataFormats.Bitmap);

     }

Image is displayed in picturebox1 on my pc, but not on my friend’s. On another windows XP it worked well after installing VS2008. So I guess IHTMLDocument2 needs a windows update to work correctly.

Which update is that? Or any other alternative to this code in which i don’t have to redownload image from internet?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:23:25+00:00Added an answer on May 25, 2026 at 1:23 am

    Sounds like you need to deploy additional files (dlls?) available Here.

    The best option (and what most people do) is to use something like System.Net.WebClient to download the source, and the use WebClient again to download the image.

    If you are determined to use an interface for HTML IHTMLDocument2 the file that contains this interface is in C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll (without the x86 if you are running 32-bit Windows). Include this file in your project if you are using a VS Deployment project (or copy it to the running application directory manually).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my WinForms application, I have a WebBrowser control which displays a page. When
I have a winform application that i embeded a webrowser control. I load an
I have a WinForms C# application. There is a WebBrowser control on the form
I have a winform application (.NET 2.0 C#). From this application, I want to
In my winforms aplication I have a WebBrowser control named webBrowser1. In code all
I have a C# WinForms application that has a WebBrowser control inside of it.
I have an application (winform exe) that I run several times. Does this mean
I have an c# winform application that runs under a local account but needs
I have developed a WinForm Application with VB.Net (VS2010) having Office 2010 Professional Installed,
I have a winform application which contains a window resizable but one requirement is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.