protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            TabSelectedEventArgs ev = null;

            if (this.ActiveHitTest(e.X, e.Y))
            {
                ev = new TabSelectedEventArgs(TabType.Active);
            }
            else if (this.InactiveHitTest(e.X, e.Y))
            {
                ev = new TabSelectedEventArgs(TabType.Inactive);
            }
            else if (this.MouseOverHitTest(e.X, e.Y))
            {
                ev = new TabSelectedEventArgs(TabType.MouseOver);
            }
            if (ev != null)
            {
                if (this.TabSelected != null)
                {
                    this.TabSelected(ev);
                }
            }
        }
 private void _template_TabSelected(TabSelectedEventArgs e)
 {
     if (e.TabType == TabType.Active)
     {
         this.cboTabType.SelectedItem = "Active Tab";
     }
     else if (e.TabType == TabType.Inactive)
     {
         this.cboTabType.SelectedItem = "Inactive Tab";
     }
     else
     {
         this.cboTabType.SelectedItem = "Mouseover Tab";
     }
 }