Microsoft Knowledge Base Email Alertz

KBAlertz.com: (312120) - When you place an ActiveX control that was created in Visual Basic 6.0 or Visual C++ 6.0 on a form in a Visual Studio .NET Windows application, the control may disappear from the form in the design view. The control disappears when you use the...

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 312120 - Last Review: January 25, 2006 - Revision: 3.4

BUG: An ActiveX control may disappear from a form in design view in a Visual Studio .NET Windows application

This article was previously published under Q312120

On This Page

SYMPTOMS

When you place an ActiveX control that was created in Visual Basic 6.0 or Visual C++ 6.0 on a form in a Visual Studio .NET Windows application, the control may disappear from the form in the design view. The control disappears when you use the Properties window to set the value of a form property, such as ShowInTaskBar.

CAUSE

If you set any property of the form (such as ShowInTaskBar), the form's handle is recreated. Some ActiveX controls hide their windows when the parent's Hwnd gets a WM_DESTROY message. This sets the control's STATE_VISIBLE property to false inside the property's state bits. When the form's handle is recreated, the control's handle is not recreated because the control's STATE_VISIBLE property is set to false.

RESOLUTION

To work around the problem, you can set the properties in the Form_Load event instead of in the Properties window.

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 Behavior

  1. Use Visual Basic 6.0 to create a UserControl, or use Visual C++ 6.0 to create an Active Template Library (ATL) or Microsoft Foundation Classes (MFC) control.
  2. Register the control on the computer that has Visual Studio .NET installed.
  3. Start Visual Studio .NET. Use Visual Basic .NET, Visual C# .NET, or Visual J# .NET to create a new Windows application. Form1 is created by default.
  4. Right-click the Toolbox window, and then click Customize Toolbox on the shortcut menu.
  5. Click the COM Components tab. Select the ActiveX control that you created in step 1 from the list. Click OK, and the control will appear in the Toolbox.
  6. Add this control to Form1.
  7. In the Properties window, change the value of the Form1 ShowInTaskBar property.

    The ActiveX control disappears from the form immediately.

APPLIES TO
  • Microsoft .NET Framework 1.0
  • Microsoft Visual Basic .NET 2002 Standard Edition
  • Microsoft Visual C# .NET 2002 Standard Edition
  • Microsoft Visual J# .NET 2003 Standard Edition
Keywords: 
kbvs2005doesnotapply kbvs2005swept kbtshoot kbvs2002sp1sweep kbbug kbpending kbreadme KB312120
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please