title: How to switch Oval Shape backcolor after clicking on it?
body: <p>So thats my code, it works with a button but it doesnt work with my OvalShape. I need it for a Master Mind game in C#. The Oval shape should Change the Color after clicking on it. Its supposed  to be able to Change into 6 Colors Red,Yellow,Blue,White,Green and Purple.</p>
  
  <pre><code>     private void ovalShape1_4_Click(object sender, EventArgs e)
      {
          Control ctrl = ((Control)sender);
          switch (ctrl.BackColor.Name)
          {
              case "Red":
                  ctrl.BackColor = Color.Yellow;
                  break;
              case "Black":
                  ctrl.BackColor = Color.Green;
                  break;
              case "White":
                  ctrl.BackColor = Color.Red;
                  break;
              case "Yellow":
                  ctrl.BackColor = Color.Purple;
                  break;
              default:
                  ctrl.BackColor = Color.Red;
                  break;
  
  
  
  
  
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;
  using Microsoft.VisualBasic.PowerPacks;
  
  namespace Mastermind2
  {
      public static class ControlCollectionExtension
      {
          public static IList&lt;OvalShape&gt; ToList(this ShapeCollection aiShapeCollection)
          {
              IList&lt;OvalShape&gt; aoShapes = new List&lt;OvalShape&gt;();
  
              foreach (OvalShape ctrl in aiShapeCollection)
                  aoShapes.Add(ctrl);
  
              return aoShapes;
          }
      }
  }
  </code></pre>