TabControl.DeselectTab 方法

定義

將所指定索引標籤之後的索引標籤設為目前的索引標籤。Makes the tab following the specified tab the current tab.

多載

DeselectTab(Int32)

將具有指定之索引的索引標籤之後的索引標籤設為目前的索引標籤。Makes the tab following the tab with the specified index the current tab.

DeselectTab(String)

將具有指定之名稱的索引標籤之後的索引標籤設為目前的索引標籤。Makes the tab following the tab with the specified name the current tab.

DeselectTab(TabPage)

將所指定 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.

public:
 void DeselectTab(int index);
public void DeselectTab (int index);
member this.DeselectTab : int -> unit
Public Sub DeselectTab (index As Integer)

參數

index
Int32

要在索引標籤的 TabPages 集合中取消選取的索引。The index in the TabPages collection of the tab to deselect.

例外狀況

index 小於 0 或大於 TabPage 集合中之 TabPages 控制項的數目減 1。index is less than 0 or greater than the number of TabPage controls in the TabPages collection minus 1.

備註

使用此方法,以程式設計方式取消選取 TabControl中的特定索引標籤。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.

另請參閱

DeselectTab(String)

將具有指定之名稱的索引標籤之後的索引標籤設為目前的索引標籤。Makes the tab following the tab with the specified name the current tab.

public:
 void DeselectTab(System::String ^ tabPageName);
public void DeselectTab (string tabPageName);
member this.DeselectTab : string -> unit
Public Sub DeselectTab (tabPageName As String)

參數

tabPageName
String

要取消選取之索引標籤的 NameThe Name of the tab to deselect.

例外狀況

tabPageNamenulltabPageName is null.

-或--or- tabPageNameName 集合中任何 TabPageTabPages 屬性都不相符。tabPageName does not match the Name property of any TabPage in the TabPages collection.

備註

使用此方法,以程式設計方式取消選取 TabControl中的特定索引標籤。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.

另請參閱

DeselectTab(TabPage)

將所指定 TabPage 之後的索引標籤設為目前的索引標籤。Makes the tab following the specified TabPage the current tab.

public:
 void DeselectTab(System::Windows::Forms::TabPage ^ tabPage);
public void DeselectTab (System.Windows.Forms.TabPage tabPage);
member this.DeselectTab : System.Windows.Forms.TabPage -> unit

參數

tabPage
TabPage

要取消選取的 TabPageThe TabPage to deselect.

例外狀況

index 小於 0 或大於 TabPage 集合中之 TabPages 控制項的數目減 1。index is less than 0 or greater than the number of TabPage controls in the TabPages collection minus 1.

-或--or- tabPage 不在 TabPages 集合中。tabPage is not in the TabPages collection.

tabPagenulltabPage is null.

備註

使用此方法,以程式設計方式取消選取 TabControl中的特定索引標籤。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.

另請參閱

適用於