title: Increase Width and Height of Headers in TabControl
body: <p>I don't like <code>TabControl</code>, they look ugly. So I'm creating my own custom drawn <code>TabControl</code>. I have some problems with header height. my control look like below:</p>
  
  <p><a href="https://i.stack.imgur.com/WdM4E.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WdM4E.jpg" alt="enter image description here"></a></p>
  
  <p>Control constructor:</p>
  
  <pre><code>this.SetStyle(ControlStyles.UserPaint, true);
  this.SetStyle(Conbut trolStyles.OptimizedDoubleBuffer, true);
  SetStyle(ControlStyles.AllPaintingInWmPaint, true);
  this.DrawMode = TabDrawMode.OwnerDrawFixed;
  </code></pre>
  
  <p>And <code>OnPaintBackground</code>:</p>
  
  <pre><code>var g = pevent.Graphics;
  var Count = this.TabCount - 1;
  int Offset = 2;
  int index = 0;
  foreach (TabPage itemtab in this.TabPages)
  {
    //SizeF sz = g.MeasureString(itemtab.Text, this.Font);
    var tabrect = this.GetTabRect(index);
    var headerrect = new Rectangle(tabrect.Left + Offset, tabrect.Y, tabrect.Width, tabrect.Height);
    DrawRoundedRectangle(g, Headerbrush, headerrect, 3);
    g.DrawString(itemtab.Text, this.Font, textbrush, headerrect, str);
    if (index &lt; Count) index++;
  }
  </code></pre>
  
  <p>I tried to add this line:</p>
  
  <pre><code>this.ItemSize = new Size(100, 30); 
  </code></pre>
  
  <p>But width returns wrong value when changing the font's size or the text of header.</p>
  
  <p><a href="https://i.stack.imgur.com/d4D9a.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d4D9a.jpg" alt="enter image description here"></a></p>
  
  <p>Is there a way increase widths and height of header?</p>