Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: A Windows Forms control is not printed when you host the control in Internet Explorer


View products that this article applies to.

This article was previously published under Q329646

↑ Back to the top


Symptoms

When you host a Windows Forms control on a Web page in Internet Explorer, the control renders and displays properly. However, when you print or print preview the page, the control does not appear at all.

Note This problem does not occur with unmanaged ActiveX controls.

↑ Back to the top


Cause

To print a form or a control, a .NET application renders the content to a bitmap and then prints the bitmap. However, when Internet Explorer tries to print an HTML page, it first renders the page to a metafile and then prints the metafile. This problem occurs in Internet Explorer because Graphics Device Interface (GDI) has some limitation in printing to a metafile device context.

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


More information

Steps to Reproduce the Problem

  1. Create a .NET Windows Form control.
  2. Add the control in an HTML page with the <OBJECT> tag. For example:
    <OBJECT id="anyid" classid="component-name.dll#namespace-path.control-name"></OBJECT>
    						
  3. Open the HTML page in Internet Explorer. Notice that you can see your control in Internet Explorer.
  4. Click Print Preview on the File menu. Notice that the control does not appear.
  5. Click Print on the File menu. Notice that the printed document does not include the control.

↑ Back to the top


References

For more information about hosting secure, lightweight, client-side controls in Internet Explorer, visit the following Microsoft Developer Network (MSDN) Web site:

↑ Back to the top


Keywords: KB329646, kbvs2002sp1sweep, kbpending, kbbug

↑ Back to the top

Article Info
Article ID : 329646
Revision : 4
Created on : 6/22/2006
Published on : 6/22/2006
Exists online : False
Views : 353