Public Class DialogPoint
Private FixedWidth As Integer = 50
Private FixedHeight As Integer = 50
Public Sub New()
Me.SetStyle(Windows.Forms.ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(Windows.Forms.ControlStyles.UserPaint, True)
Me.SetStyle(Windows.Forms.ControlStyles.OptimizedDoubleBuffer, True)
Me.SetStyle(Windows.Forms.ControlStyles.ResizeRedraw, True)
Me.SetStyle(Windows.Forms.ControlStyles.FixedHeight, True)
Me.SetStyle(Windows.Forms.ControlStyles.FixedWidth, True)
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Me.BackColor = Color.Red
Dim path As New Drawing2D.GraphicsPath
path.AddEllipse(New RectangleF(0, 0, FixedWidth, FixedHeight))
Dim circle As New Region(path)
Me.Region = circle
End Sub
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(e)
Dim brush As SolidBrush = New SolidBrush(Color.Yellow)
e.Graphics.FillEllipse(Brushes.Yellow, New RectangleF(0, 0, FixedWidth, FixedHeight))
End Sub
Protected Overrides Sub SetBoundsCore(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal specified As BoundsSpecified)
MyBase.SetBoundsCore(x, y, FixedWidth, FixedHeight, specified)
End Sub
End Class