Export (0) Print
Expand All

UserControl Changes in Visual Basic .NET

In Visual Basic 6.0, UserControl projects (also known as ActiveX Control projects) were used to create ActiveX controls. After they were compiled, UserControls could be hosted in any container that supported ActiveX, including Visual Basic 6.0 forms and Internet Explorer.

In Visual Basic .NET, Windows Control Library projects are used to create controls that can be hosted in Windows Forms applications. When a Visual Basic 6.0 UserControl project is upgraded to Visual Basic .NET, it is upgraded to a Windows Control Library; the resulting control can no longer be hosted in Internet Explorer.

In Visual Basic 6.0, before adding a UserControl to a form at design time, you had to close the UserControl Designer; this step automatically compiled (built) the control. When subsequent changes were made to the UserControl, they would not be reflected in the instance of the UserControl on the form until the application was run; if open, the UserControl designer would automatically close.

In Visual Basic .NET, a UserControl can be added to a form without closing the UserControl Designer; however, the UserControl must be built before it can be added to a form. Simply closing the UserControl designer does not build the control. Any subsequent changes to the UserControl are not reflected on the form designer until the UserControl is rebuilt; a UserControl is automatically rebuilt each time you debug your test application.

In Visual Basic 6.0, the ReadProperties and WriteProperties events were used to retrieve or save a UserControl's values to a PropertyBag object.

In Visual Basic .NET, the PropertyBag object is no longer supported, and the ReadProperties and WriteProperties events no longer exist. Instead, serialization is used to save and retrieve properties in either a binary or SOAP format.

See Also

PropertyBag Changes in Visual Basic .NET | Walkthrough: Persisting an Object in Visual Basic .NET | Control Authoring for Windows Forms | The contents of the template file were not upgraded | WebClass state management is not supported | WebClass event is not supported

Show:
© 2014 Microsoft