protected override void OnPaint(PaintEventArgs e)
{
if (comboBox1.Text == "Circle")
{
e.Graphics.FillEllipse(Brushes.Red, new Rectangle(105, 120, 64, 64));
}
if (comboBox1.Text == "Rectangle")
{
e.Graphics.FillRectangle(Brushes.Red, new Rectangle(105, 120, 75, 50));
}
if(comboBox1.Text == "Triangle")
{
Point[] points = { new Point(140, 110), new Point(230, 190), new Point(50, 190) };
e.Graphics.FillPolygon(Brushes.Red, points);
}
}
I've created these shapes above and they're within a combo box so but I'm trying to get it so my second combo box will change the color of the shape, is there any way to do this? I can't seem to find it anywhere. The second combo box contains Red, Green, Blue, Custom Colour. I have it so the colour palette comes up but I don't know how to set it to the shape when selected either.
How would I reference the shapes and change the brush color is the part I'm struggling with