Freigeben über


CTabCtrl::SetCurSel

Selects a tab in a tab control.

int SetCurSel(
  int nItem 
);

Parameters

  • nItem
    The zero-based index of the item to be selected.

Return Value

Zero-based index of the previously selected tab if successful, otherwise – 1.

Remarks

A tab control does not send a TCN_SELCHANGING or TCN_SELCHANGE notification message when a tab is selected using this function. These notifications are sent, using WM_NOTIFY, when the user clicks or uses the keyboard to change tabs.

Requirements

Header: afxcmn.h

See Also

Concepts

CTabCtrl Class

CTabCtrl Members

Hierarchy Chart

CTabCtrl::GetCurSel

CTabCtrl::GetCurFocus