O'Reilly logo

Visual Basic 2008 Recipes: A Problem-Solution Approach by Rakesh Rajan, Matthew MacDonald, Allen Jones, Todd Herman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1.2. Create a Windows-Based Application from the Command Line

Problem

You need to use the VB .NET command-line compiler to build an application that provides a Windows Forms-based GUI.

Solution

Create a class that inherits from the System.Windows.Forms.Form class. (This will be your application's main form.) In one of your classes, ensure you implement a Shared method named Main. In the Main method, create an instance of your main form class and pass it to the Shared method Run of the System.Windows.Forms.Application class. Build your application using the command-line VB .NET compiler, and specify the /target:winexe compiler switch.

How It Works

Building an application that provides a simple Windows GUI is a world away from developing a full-fledged ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required