Error message when you upgrade a Visual Basic 6.0 project to Visual Basic .NET 2003: "UserControlName.ToolboxBitmap was not upgraded" (820650)



The information in this article applies to:

  • Microsoft Visual Basic .NET (2003)

SYMPTOMS

In Microsoft Visual Basic 6.0, if you upgrade an ActiveX Control project or a project that contains a user control file by using the Visual Basic Upgrade Wizard, and the ToolboxBitmap property is set for the user control file, then the Visual Basic Upgrade Wizard reports the following error:
UserControl property UserControlName.ToolboxBitmap was not upgraded.
Therefore, when you build your project in Microsoft Visual Basic .NET, you receive the default bitmap of the user control file that is in the toolbox instead of the ToolboxBitmap that you selected in the Visual Basic 6.0 project.

WORKAROUND

To work around this problem, add the ToolboxBitmapAttribute to the user control after you upgrade your Visual Basic 6.0 project. To do this, follow these steps:
  1. In Solution Explorer, right-click Project Name, point to Add, and then click Add Existing Item.
  2. Locate the .bmp file that is associated with the user control file, and then click Open.
  3. Rename the .bmp file to the user control name.

    For example, if the user control name is UserControl1, rename the .bmp file UserControl1.bmp.
  4. In Solution Explorer, right-click the .bmp file, and then click Properties.
  5. In the Properties window, set the Build Action property to Embedded Resource.
  6. In Solution Explorer, right-click UserControl1.vb, and then click View Code.
  7. Add the following ToolboxBitmap attribute to the UserControl1 class:
    <ToolboxBitmap(GetType(UserControl1), "UserControl1.BMP")> _
     Public Class UserControl1
    	...
    End Class
    

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Create an ActiveX Control project in Visual Basic 6.0.
  2. Right-click UserControl1, and then click Properties.
  3. In the Properties window, set the ToolboxBitmap property of UserControl1 to Bitmap (for example, C:\MyBitmapName.bmp).
  4. Verify that the user control file has a specified bitmap in the toolbox, and then click Save.
  5. Open Microsoft Visual Studio .NET (2003).
  6. On the File menu, point to Open, and then click Project.
  7. Locate the project that you saved in step 4, and then click the project.
  8. Follow the instructions in the Visual Basic Upgrade Wizard to upgrade your Visual Basic 6.0 ActiveX Control project to a Microsoft Visual Basic .NET project.
  9. In Solution Explorer, double-click the _UpgradeReport.htm file.
  10. Expand UserControl1.vb.

    You receive the error that is mentioned in the "Symptoms" section of this article.
  11. On the Build menu, click Build Solution to create the control.
  12. In the toolbox, click Add/Remove Items.
  13. Click Browse, and then click the control that you created in step 11.
  14. In the toolbox, verify that you receive the default icon for the user control.

Modification Type:MinorLast Reviewed:2/3/2006
Keywords:kbvs2005doesnotapply kbvs2005swept kbControl kbUpgrade kbprb KB820650 kbAudDeveloper