title: How to paint only selected tab
body: <p>I have a tabcontrol with <code>DrawMode</code> set to <code>OwnerDrawFixed</code>. I have been able to draw the tab and color it <code>Black</code> what i want to do is to draw a seperate paint for the selected tab and color it <code>Gray</code>. This is my <code>Draw_Item</code> event.</p>
  
  <pre><code>private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
  {
      //This is the code i want to use to color the selected tab (e.Graphics.FillRectangle(Brushes.Gray, e.Bounds.X, e.Bounds.Y, 200, 32);
      e.Graphics.FillRectangle(Brushes.Black, e.Bounds.X, e.Bounds.Y, 200, 32);
      e.Graphics.DrawString("x", e.Font, Brushes.Black, e.Bounds.Right-17, e.Bounds.Top+4);
      e.Graphics.DrawString(this.tabControl1.TabPages[e.Index].Text, e.Font, Brushes.White, e.Bounds.Left + 12, e.Bounds.Top + 4);
      e.DrawFocusRectangle();
      if (e.Index == activeButton)
          ControlPaint.DrawBorder(e.Graphics, new Rectangle(e.Bounds.Right - 22, e.Bounds.Top + 4, 20, 20), Color.Blue, ButtonBorderStyle.Inset);
  }
  </code></pre>
  
  <p>I have created a global variable <code>TabPage  current</code> that i want to use to store the current tab page and in <code>SelectedIndexChanged</code> event i have assigned the selected tab to the variable and called <code>Invalidate();</code> to force repaint of the tab.</p>
  
  <pre><code>private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
  {
      current = tabControl1.SelectedTab;
      tabControl1.Invalidate();
  }
  </code></pre>
  
  <p>Now where I'm stuck is how to color only the selected tab in the <code>DrawItem</code> event.</p>
  
  <p>My Question now is how do i check for selected tab in the <code>DrawItem</code> event and paint only the selected tab.</p>