Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Component Authoring
Component Classes
 Component Instancing Changes in Vis...
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework
Component Instancing Changes in Visual Basic

Updated: November 2007

In Visual Basic 6.0, instance creation was controlled by the Instancing property of a class, which set both the access level (Public, Private, Friend) of a class and the way an object could be created.

In Visual Basic .NET, you set the access modifier for a class to Public, Private, or Friend, and then specify the user's ability to create instances of the class by setting the access level of the constructor (Sub New), as shown in the following table.

Visual Basic 6.0 Instancing

Visual Basic .NET

Private

Class Access attribute: Private

PublicNotCreatable

Class Access attribute: Public. Declare the constructor Friend (Friend Sub New)

SingleUse

Not supported*

GlobalSingleUse

Not supported*

MultiUse

Class Access attribute: Public. Declare the constructor Public (Public Sub New)

GlobalMultiUse

Not supported*

* There is no combination of class access and constructor access that duplicates SingleUse, GlobalSingleUse, or GlobalMultiUse. You can get an effect similar to GlobalMultiUse by importing a class into a client program, although this only makes shared members accessible without qualification. Public modules also allow a similar effect.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker