O'Reilly logo

A Programmer's Guide to .NET by Alexei Fedorov

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

8.1. Windows forms – an introduction

Let’s start our discussion by creating a simple example of a Windows application that will run under Microsoft .NET. Here is the code:

'-------------------------------------------
' WinMin – Minimal .NET Windows Application 
'-------------------------------------------
Imports System 
Imports System.Windows.Forms 

 Public Class MyForm 
  Inherits System.Windows.Forms.Form 

  Shared Sub Main() 
   System.Windows.Forms.Application.Run(New MyForm()) 
  End Sub 

  Public Sub New() 
   MyBase.New() 
  End Sub 
 End Class 

We compile this code with the following command line:

> vbc WinMin.vb /t:WinExe /r:system.dll /r:system.windows.forms.dll 

where:

  • vbc is the Visual Basic.NET command-line compiler;

  • WinMin.vb is the name of the source file; ...

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