/// <summary>
        /// Fires the <see cref="TabChanging"/> event.
        /// </summary>
        /// <param name="tcea">
        /// Some <see cref="TabChangingEventArgs"/> for the event.
        /// </param>
        protected virtual void OnTabChanging(TabChangingEventArgs tcea)
        {
            if (IsNewTab(tcea.NewIndex))
            {
                var tab = this.Controls[tcea.NewIndex];
                tab.Tag = "WAS_NEW_TAB";
                tab.Text = "";
                var newTab = AddNewTab();
                //tcea.Cancel = true;
                OnNewTabButtonClicked(new NewTabEventArgs(newTab));
            }

            if (TabChanging != null)
            {
                TabChanging(this, tcea);
            }
        }
Exemplo n.º 2
0
 private void HandleChangingTab(object sender, TabChangingEventArgs args)
 {
     args.Cancel = args.NewIndex == 1 && _preventSelection.Checked;
 }