Private bg As Color Public Property bgcolor() As Color Get bgcolor = bg End Get Set(ByVal Value As Color) bg = Value End Set End Property
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim graphics As Graphics = e.Graphics Dim penWidth As Integer = 1 Dim pen As Pen = New Pen(Color.Black, 1)
Dim fontHeight As Integer = 10 Dim font As Font = New Font("Arial", fontHeight)
Dim brush As SolidBrush = New SolidBrush(bg) graphics.FillEllipse(brush, 0, 0, Width, Height) Dim textBrush As SolidBrush = New SolidBrush(Color.Black)
graphics.DrawEllipse(pen, CInt(penWidth / 2), _ CInt(penWidth / 2), Width - penWidth, Height - penWidth)
graphics.DrawString(Text, font, textBrush, penWidth, _ Height / 2 - fontHeight) End Sub