title: Change color of panel when mouse clicked?
body: <p>I am very new to visual C#</p>
  
  <p>I want to make a ticket booking system (like in cinemas), I have created the seats using panel, each seating is <code>40 * 40</code></p>
  
  <p>Here's my code:</p>
  
  <pre><code>private void panel2_Paint(object sender, PaintEventArgs e)
  {
      int a, b;
  
      for (a = 0; a &lt;= 1; a++)
      {
          for (b = 0; b &lt; 12; b++)
          {
  
              Graphics g = e.Graphics;
              g.FillRectangle(new SolidBrush(Color.White), b * 40, a * 40, 40, 40);
              g.DrawRectangle(new Pen(Color.Black), b * 40, a * 40, 40, 40);
  
          }
      }
  }
  </code></pre>
  
  <p>Now I want to change the color of each seating by a mouse click to show what seat has been selected; but so far no luck</p>