title: Close button for TabPages of Right To Left TabControl c#
body: <p>I want to add a close button to <code>TabPages</code> of a <code>TabControl</code>. I try this code and it works fine with a Left To Right TabControl:</p>
  
  <pre><code>private Point _imageLocation = new Point(13, 5);
  private Point _imgHitArea = new Point(13, 2);
  
  this.tabControl2.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
  
  tabControl2.DrawItem += TabControl2_DrawItem;
  
  private void TabControl2_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
  {
      try
      {
          Image img = new Bitmap(GestionP.Properties.Resources.Close);
          Rectangle r = e.Bounds;
          r = this.tabControl2.GetTabRect(e.Index);
          r.Offset(2, 2);
          Brush TitleBrush = new SolidBrush(Color.Black);
          Font f = this.Font;
          string title = this.tabControl2.TabPages[e.Index].Text;
          e.Graphics.DrawString(title, f, TitleBrush, new PointF(r.X, r.Y));
  
          if (tabControl2.SelectedIndex &gt;= 1)
          {
              e.Graphics.DrawImage(img, new Point(r.X + (this.tabControl2.GetTabRect(e.Index).Width - _imageLocation.X), _imageLocation.Y));
          }
  
      }
          catch (Exception) { }
  }
  
      private void tabControl2_MouseClick(object sender, MouseEventArgs e)
      {
          TabControl tc = (TabControl)sender;
          Point p = e.Location;
          int _tabWidth = 0;
          _tabWidth = this.tabControl2.GetTabRect(tc.SelectedIndex).Width - (_imgHitArea.X);
          Rectangle r = this.tabControl2.GetTabRect(tc.SelectedIndex);
          r.Offset(_tabWidth, _imgHitArea.Y);
          r.Width = 16;
          r.Height = 16;
          if (tabControl2.SelectedIndex &gt;= 1)
          {
              if (r.Contains(p))
              {
                  TabPage TabP = (TabPage)tc.TabPages[tc.SelectedIndex];
                  tc.TabPages.Remove(TabP);
  
              }
          }
      }
  </code></pre>
  
  <p>But when I set the property <code>RightToLeftLayout = true</code> and <code>RightToLeft = true</code>  it doesn't work, <code>TabPage</code> titles don't appear and also close button.</p>
  
  <p>So how to fix the code in a way that accepts <code>RightToLeft</code> property?</p>