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



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 5.5
  • Microsoft Visual Studio .NET (2002), Professional Edition

This article was previously published under Q329646

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.

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.

STATUS

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

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.

REFERENCES

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

Modification Type:MajorLast Reviewed:6/22/2006
Keywords:kbvs2002sp1sweep kbpending kbbug KB329646 kbAudDeveloper