Visual Basic - Easily Incorporate Code From Other Files Into Your Application (VB .NET)

Typically, when you need to borrow code from another application and rework it for your own purposes, you open the source file, cut the code from the file, and paste it into your application file. However, with Visual Studio .NET, you can pull the entire contents of the file into your application without cutting and pasting. To see what we mean:

  • Use the Project | Add Class menu option to add a new class to your .NET project
  • Next, delete the default class code
  • Select Edit | Insert File As Text from the main menu
  • Use the resulting dialog box to choose an existing class file
  • Click the Open button

When you do this, .NET loads the entire contents of the file into the class code window.

Go back