Tag Archives: draw line

How to Draw String on a Form or Control using VB.NET

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

This will draw a string on the WindowsForm using Visual Basic.NET

'create a new brush with a single, solid color

Dim myBrush AsNew SolidBrush(Color.Purple)

'create a new basic font. you can mess around and make it cooler

Dim f As Font = New Font(Font.Bold, 20)

'draw the string onto the form. At Position (0 left), (10 top)

Me.CreateGraphics.DrawString("Hello, This is just a test!", f, myBrush, 0, 10)