System.Windows.Forms.TabControl.DeselectTab C# (CSharp) Method

DeselectTab() public method

public DeselectTab ( int index ) : void
index int
return void
		public void DeselectTab (int index)
		{
			if (index == SelectedIndex) {
				if (index >= 0 && index < this.tab_pages.Count - 1)
					SelectedIndex = ++index;
				else
					SelectedIndex = 0;
			}
		}

Same methods

TabControl::DeselectTab ( TabPage tabPage ) : void
TabControl::DeselectTab ( string tabPageName ) : void

Usage Example

Example #1
0
        public void ux_tabcontrolCreateNewTab(TabControl ux_tabcontrolDataview, int indexOfNewTab)
        {
            DataviewProperties dvp = new DataviewProperties();
            dvp.TabName = "";
            dvp.DataviewName = "";
            dvp.StrongFormName = "";
            dvp.ViewerStyle = "Spreadsheet";
            dvp.AlwaysOnTop = "false";

            DataviewTabProperties newTabDialog = new DataviewTabProperties(_webServices, dvp);
            newTabDialog.StartPosition = FormStartPosition.CenterParent;
            if (newTabDialog.ShowDialog() == DialogResult.OK)
            {
                ux_tabcontrolAddTab(ux_tabcontrolDataview, newTabDialog.TabProperties.TabName, newTabDialog.TabProperties, indexOfNewTab);
                ux_tabcontrolDataview.SelectedIndex = indexOfNewTab;
                //SetDGVMainDataviewUserSettings();
            }
            else
            {
                ux_tabcontrolDataview.DeselectTab(indexOfNewTab);
            }
        }
All Usage Examples Of System.Windows.Forms.TabControl::DeselectTab