C#: This program lets you pick from a choice of 8 items: Circle, Square, Ellipse, Pie, Filled Circle, Filled Square, Filled Ellipse, and Filled Pie. When Square is selected, it draws and displays a square . I want to add 1 button to change the color of the sharp which I want to create. How can I get it. ajal ComboBox Test Square Square Ellipse Pie Filled Circle Filled Square Filled Ellipse Filled Pie Solution using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace graphics { public partial class Form1 : Form { public Form1() { InitializeComponent(); } Pen red = new Pen(Color.Black); private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { panel1.Refresh(); if (comboBox1.SelectedIndex == 2) { SolidBrush sb = new SolidBrush(Color.White); Graphics g = panel1.CreateGraphics(); g.DrawEllipse(red,20, 20, 220, 90); } if (comboBox1.SelectedIndex == 1) { //panel1.Refresh(); SolidBrush sb = new SolidBrush(Color.White); Graphics g = panel1.CreateGraphics(); g.DrawRectangle(red, 20, 20, 20, 20); } if (comboBox1.SelectedIndex == 3) { SolidBrush sb = new SolidBrush(Color.White); Graphics g = panel1.CreateGraphics(); g.DrawPie(red, 100, 70, 50, 50, 60, 20); } if (comboBox1.SelectedIndex == 0) { int radius=50; SolidBrush sb = new SolidBrush(Color.White); Graphics g = panel1.CreateGraphics(); g.DrawEllipse(red, 100 - radius, 100 - radius, radius + radius, radius + radius); } if (comboBox1.SelectedIndex == 4) { int radius = 50; SolidBrush sb = new SolidBrush(Color.Red); Graphics g = panel1.CreateGraphics(); g.DrawEllipse(red, 100 - radius, 100 - radius, radius + radius, radius + radius); g.FillEllipse(sb, 100 - radius, 100 - radius, radius + radius, radius + radius); } if (comboBox1.SelectedIndex == 5) { SolidBrush sb = new SolidBrush(Color.Red); Graphics g = panel1.CreateGraphics(); g.DrawRectangle(red, 100, 100, 100, 100); g.FillRectangle(sb, 100, 100, 100, 100); } if (comboBox1.SelectedIndex == 6) { SolidBrush sb = new SolidBrush(Color.Red); Graphics g = panel1.CreateGraphics(); g.DrawEllipse(red, 20, 20, 220, 90); g.FillEllipse(sb, 20, 20, 220, 90); } if (comboBox1.SelectedIndex == 7) { SolidBrush sb = new SolidBrush(Color.Red); Graphics g = panel1.CreateGraphics(); g.DrawPie(red, 100, 70, 50, 50, 60, 20); g.FillPie(sb, 100, 70, 50, 50, 60, 20); } } } }.