title: How to set back color on mouse leave in menu item.?
body: <p>A <strong>menu tool strip</strong> is used in <strong>WinForm</strong> application. On checking menu option, it opens sub menus. <em>When mouse enters in the boundary of sub menu the back color is change to green. Now, I want to change this color to red, when mouse leave the boundary of sub-menu.</em>
  Any suggestions ?  </p>
  
  <pre><code>protected override void OnPaint(PaintEventArgs e)
  {
      base.OnPaint(e);
  
      SolidBrush brush;
      Rectangle r = new Rectangle(this.Bounds.Width - 20, 2, 16, 17);
  
      // If click on Del(Close Icon)
      if (bOnDel)
      {
          brush = new SolidBrush(Color.LightBlue);
          e.Graphics.FillRectangle(brush, r);
          brush.Color = Color.Blue;
          e.Graphics.DrawRectangle(new Pen(brush, 1), r);
      }
      // If didn't click on Del(Close Icone)
      if (!bOnDel)
      {
  
          brush = new SolidBrush(Color.FromKnownColor(KnownColor.Transparent));
          e.Graphics.FillRectangle(brush, r);
          brush.Color = Color.FromKnownColor(KnownColor.Transparent);
          e.Graphics.DrawRectangle(new Pen(brush, 1), r);
      }
  
      //Code for Drawing Cross Lines
  
      brush = new SolidBrush(Color.Gray);
      Rectangle rCross = new Rectangle(this.Bounds.Width - 15, 8, 6, 6);
      e.Graphics.DrawLine(new Pen(brush, 2), new Point(rCross.Right, rCross.Top), new Point(rCross.Left, rCross.Bottom));
      e.Graphics.DrawLine(new Pen(brush, 2), new Point(rCross.Left, rCross.Top), new Point(rCross.Right, rCross.Bottom));
  }
  </code></pre>