Public Class Form1

 

   

    Private Sub drawText(ByVal e As PaintEventArgs)

        Dim myText As String = "Drawing Text on a Form  - Visual Basic .NET 2005!"

 

        Dim fontFamily As New FontFamily("Arial")

        Dim font As New Font( _

           fontFamily, _

           14, _

           FontStyle.Bold, _

           GraphicsUnit.Point)

        e.Graphics.DrawString(myText, font, Brushes.Coral, 50, 100)

       

    End Sub

 

    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

        drawText(e)

    End Sub

 

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Me.Close()

    End Sub

End Class