Upgrading Your First VB6 Application

To get a feel for what the Migration Wizard does for you and what modifications you'll need to make, you will create a new, simple VB6 application and then run it through the Migration Wizard.

Start VB6 and create a new Standard EXE project. Put a text box, a list box, and two buttons on the form. Using the Properties window, change the Sorted property of the list box to True.

Double-click on the first button to open the code window. Enter the following code in the Command1_Click event procedure:

Private Sub Command1_Click()
    List1.AddItem Text1
    List1.ListIndex = List1.NewIndex
End Sub

Press F5 to run the application. Notice that each time you click the command button, the contents of the text box are added ...

Get A Programmer's Introduction to Visual Basic® .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.