Public Class GraphicsCircle
    Inherits GraphicsItem

    Public Overrides Sub Draw(ByVal graphics As _
           System.Drawing.Graphics)
        If IsFilled = True Then
            ' create a new pen...
            Dim brush As New SolidBrush(Me.Color)

            ' draw the circle...
            graphics.FillEllipse(brush, Me.Rectangle)
        Else

            'create a pen
            Dim pen As New Pen(Me.Color)

            ' use DrawEllipse instead...
            Dim drawRectangle As Rectangle = Me.Rectangle
            drawRectangle.Inflate(-1, -1)
            graphics.DrawEllipse(pen, drawRectangle)

        End If

    End Sub

End Class

