TabControl.DeselectTab Method

Definition

Makes the tab following the specified tab the current tab.

Overloads

DeselectTab(String)

Makes the tab following the tab with the specified name the current tab.

DeselectTab(TabPage)

Makes the tab following the specified TabPage the current tab.

DeselectTab(Int32)

Makes the tab following the tab with the specified index the current tab.

DeselectTab(String)

Source:
TabControl.cs
Source:
TabControl.cs
Source:
TabControl.cs

Makes the tab following the tab with the specified name the current tab.

C#
public void DeselectTab(string tabPageName);

Parameters

tabPageName
String

The Name of the tab to deselect.

Exceptions

The tabPageName argument is null.

-or-

The tabPageName argument does not match the Name property of any TabPage in the TabPages collection.

Remarks

Use this method to programmatically deselect a particular tab in a TabControl. If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

DeselectTab(TabPage)

Source:
TabControl.cs
Source:
TabControl.cs
Source:
TabControl.cs

Makes the tab following the specified TabPage the current tab.

C#
public void DeselectTab(System.Windows.Forms.TabPage tabPage);

Parameters

tabPage
TabPage

The TabPage to deselect.

Exceptions

index is less than 0 or greater than the number of TabPage controls in the TabPages collection minus 1.

-or-

tabPage is not in the TabPages collection.

The tabPage argument is null.

Remarks

Use this method to programmatically deselect a particular tab in a TabControl. If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

DeselectTab(Int32)

Source:
TabControl.cs
Source:
TabControl.cs
Source:
TabControl.cs

Makes the tab following the tab with the specified index the current tab.

C#
public void DeselectTab(int index);

Parameters

index
Int32

The index in the TabPages collection of the tab to deselect.

Exceptions

index is less than 0 or greater than the number of TabPage controls in the TabPages collection minus 1.

Remarks

Use this method to programmatically deselect a particular tab in a TabControl. If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9