Previous | Index | Next 

[INFO] Controls in the support library can’t be dropped on a standard VB.NET form

The controls in VB Migration Partner’s support libraries are meant to ease the migration of existing VB6 forms and can operate correctly only if placed on the surface of a VB6Form object. Any attempt to drop such controls onto a regular VB.NET form causes either a design-time or a runtime error. This behavior is by default and shouldn’t be considered as a VB Migration Partner’s limitation.

Notice that the opposite isn’t true: you can always place standard .NET controls onto a VB6Form, even though some limitations might apply. For example, these controls can’t be part of “old-styled” control arrays or be instantiated dynamically with the Controls.Add method.

We recommend that you don’t add new VB6Form instances to the project because such freshly-created forms don’t contain all the support code that VB Migration Partner creates when migrating a VB6 form. If you absolutely need to define a new form that uses one or more controls defined in the support library, the only viable approach is adding the form to the VB6 application and then migrate it again to VB.NET.

More in general, we recommend that you never write code or new forms that use the objects and the controls defined in the CodeArchitects.VBLibrary. Using these “legacy” objects deprives you of all the benefits of the .NET Framework platform.

UPDATE: starting with version 1.34, it is possible to drop controls contained in the VBLibrary onto a standard .NET form, albeit with a few limitations. For more information, read this article.

 

Previous | Index | Next