Getting back to the complaint in the About Visual Basic Forum, the first step in solving the problem is to use the Add ... button to add a reference to Microsoft.VisualBasic.Compatibility library. Once this is done, we can move on to namespaces. For this, we can use the Imported Namespaces listbox in Project Designer. (Or not. Once the reference is added to the project, it's possible to handle it all in code from that point on.)
Unlike VB 6, a library in .NET is better organized using namespaces. You can think of these as the "real" object libraries and the reference as just the box they come in. Here's the "official" description from Microsoft:
Namespaces organize the objects defined in an assembly. Assemblies can contain multiple namespaces, which can in turn contain other namespaces. Namespaces prevent ambiguity and simplify references when using large groups of objects such as class libraries.
After you add the Microsoft.VisualBasic.Compatibility library to your project, two new entries will be added, but not selected, to the Imported Namespaces listbox in Project Designer. Scroll to the bottom and you'll see:
- Microsoft.VisualBasic.Compatibility
- Microsoft.VisualBasic.Compatibility.VB6
Although the "VB6" namespace is the only entry in the first one, it does illustrate the point that a class library is actually a tree structured container.
The concept of "importing" simply means that a namespace at a specific path can be searched automatically by Visual Studio or the Visual Basic compiler. Strictly speaking, the "Imports" keyword isn't a Visual Basic statement. It's a compiler option. That's why it has to be placed before the other statements in your source code. All the choices that are available to you are listed in the Imported Namespaces listbox. When you click the checkbox to select one, then you can simply use the methods and properties in that namespace directly in your program code.
Using the Microsoft.VisualBasic.Compatibility.VB6 namespace method to convert VB 6 twips into VB.NET pixels as an example, all of these code blocks are equivalent:
Imports Microsoft
Public Class Form1
Private Sub Form1_Load( ...
VisualBasic.Compatibility.VB6.TwipsToPixelsX(100)
End Sub
End Class
Imports Microsoft.VisualBasic
Public Class Form1
Private Sub Form1_Load( ...
Compatibility.VB6.TwipsToPixelsX(100)
End Sub
End Class
Imports Microsoft.VisualBasic.Compatibility
Public Class Form1
Private Sub Form1_Load( ...
VB6.TwipsToPixelsX(100)
End Sub
End Class
Imports Microsoft.VisualBasic.Compatibility.VB6
Public Class Form1
Private Sub Form1_Load( ...
TwipsToPixelsX(100)
End Sub
End Class
Or, if the Microsoft.VisualBasic.Compatibility.VB6 namespace is checked in the Imported Namespaces listbox, you can just code this:
TwipsToPixelsX(100)
(Note: VB.NET upgrades the way screen forms are measured from the virtually unknown twips to the almost universal pixel.)

