December 2001
Beginner
976 pages
22h 4m
English
![]() | Text |
Here we have a simple example that draws some text onto a form's display area. To demonstrate this, a new form class is created, and the OnPaint method is overridden to provide the custom drawing:
Imports System.Windows.Forms
Imports System.Drawing
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub New()
MyBase.New()
End Sub
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim font As Font
Dim text As String
' define text to be displayed on the form
text = "Graphics Programming in Visual Basic.NET"
' specify the font to use for the text display
font = New Font("San Serif", 8)
' display the text string
e.Graphics.DrawString(text, ...Read now
Unlock full access