Lesson 28

Drawing Ellipse & Circle

Learn how to draw ellipses and circles in Visual Basic 2015 using the DrawEllipse method.

28.1 Drawing Ellipse

An ellipse is an oval shape bounded by a rectangle.

Figure 28.1 – Ellipse bounded by rectangle

Method 1: Using Rectangle object

Dim g As Graphics = Me.CreateGraphics()
Dim pen As New Pen(Color.DarkTurquoise, 5)

Dim rect As New Rectangle(40, 30, 200, 100)

g.DrawEllipse(pen, rect)

Method 2: Without Rectangle object

g.DrawEllipse(pen, 40, 30, 200, 100)

Figure 28.2 – Ellipse Output

28.2 Drawing a Circle

A circle is simply an ellipse with equal width and height.

g.DrawEllipse(pen, 90, 30, 100, 100)

or using rectangle:

Dim rect As New Rectangle(90, 30, 100, 100)
g.DrawEllipse(pen, rect)

Figure 28.3 – Circle Output

Build on This Foundation

Continue to VB2026

After learning the basics of checkbox controls in VB2015, move to the newest VB2026 tutorial for a more modern VB.NET learning path.

Explore VB2026 →

Visual Basic Programming

Visual Basic Programming

Use this Top Release book to reinforce your tutorial learning with a more structured guide.

Key Takeaways:
  • Ellipse is bounded by a rectangle
  • Use DrawEllipse to draw shapes
  • Circle = equal width and height
  • Graphics + Pen are required

Next: Drawing Text

Go to Lesson 29 →