title: How to put a ContextMenu into the header of a TabPage
body: <p>I have a custom <code>TabControl</code> in which I have <code>TabPages</code> with <code>ContextMenu</code> bound to them.</p>
  
  <p>I want the menu to show up only when the page header is being clicked.</p>
  
  <p>What I do is that, when the <code>TabControl</code> is clicked, I check these conditions:</p>
  
  <pre><code>private void MouseUp(object sender, MouseEventArgs e) 
  {
      if (e.Button == Mousebuttons.Right) 
      {
          for (int i = 0; i &lt; TabCount; ++i) 
          {
              Rectangle r = GetTabRect(i);
              if (r.Contains(e.Location) /* &amp;&amp; it is the header that was clicked*/) 
              {
                  // Change slected index, get the page, create contextual menu
                  ContextMenu cm = new ContextMenu();
                  // Add several items to menu
                  page.ContextMenu = cm;
                  page.ContextMenu.Show(this, e.Location);
              }
          }
      }
  }
  </code></pre>
  
  <p><strong>If I bind <code>MouseUp</code> to the  <code>TabControl</code>, I get the  <code>ContextMenu</code> in the entire  <code>TabPage</code>. If I bind it to the  <code>TabPage</code>, I only get the  <code>ContextMenu</code> in the body and not in the header.</strong></p>
  
  <p>Is there a way to have a ContextMenu to show up only on header Click ?</p>