codice:
Imports System
Imports System.Windows.Forms
Imports System.Drawing
Public Module modmain
   Sub Main()
      Dim theForm as MainForm = new MainForm()
      theForm.Size = new Size(500, 350)
      theForm.Text = "Visual Basic.NET"
      theForm.ShowDialog()
   End Sub
End Module
Public Class MainForm
Inherits Form
   Protected Overrides Sub OnPaint(e as PaintEventArgs)
      e.Graphics.Clear(Me.BackColor)
      e.Graphics.DrawLine(new Pen(Color.Blue), 0, 0, Me.ClientSize.Width, Me.ClientSize.Height)
   End Sub
End Class