How to: Create a Solid Brush
.NET Framework 4.6 and 4.5
This example creates a SolidBrush object that can be used by a Graphics object for filling shapes.
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Red);
formGraphics = this.CreateGraphics();
formGraphics.FillEllipse(myBrush, new Rectangle(0, 0, 200, 300));
After you have finished using them, you should call Dispose on objects that consume system resources, such as brush objects.
(1500 characters remaining)
Thank you for your feedback