home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2003 January / PCpro_2003_01.ISO / born / IDE / DotNET-IDE / Templates / Form.vb < prev    next >
Encoding:
Text File  |  2002-08-21  |  1.1 KB  |  42 lines

  1. '************************************************
  2. ' File:  Form.vb  (21-Aug-2002)
  3. ' Author: G. Born www.borncity.de
  4. '
  5. ' Class with Main Sub, Creates a simple form
  6. '
  7. ' Compile with:
  8. ' vbc <name>.vbs /t:winexe /Win32Icon:<name>.ico
  9. ' /r:system.dll /r:system.windows.forms.dll 
  10. ' /r:system.drawing.dll
  11. '************************************************
  12. Option Strict
  13.  
  14. Imports System.Drawing
  15. Imports System.Windows.Forms
  16.  
  17. Module Formular
  18.  
  19.  Sub Main()                     ' Main to invoke form 
  20.   Dim oForm As New frmHaupt()   ' instantiate form
  21.   oForm.ShowDialog ()           ' show form
  22.   oForm.Dispose()               ' destroy object
  23.  End Sub
  24.  
  25.  Public Class frmHaupt
  26. ' This ist the Class-Code to create a form
  27.   Inherits System.Windows.Forms.Form
  28.   Sub New()                     ' New-Construktor to create form
  29.    MyBase.New()                 ' create from base class
  30.    With Me
  31.     .Text = "My simple form"   ' title text
  32.     .Width = 300
  33.     .Height = 100
  34.     .Left = 100
  35.     .Top = 200
  36.  
  37.  
  38.    End With
  39.   End Sub
  40.  End Class
  41. End Module
  42.