複製鏈接
請複製以下鏈接發送給好友

SetCurSel

鎖定
CurSel是一個英文縮寫,全稱是current selection,即“當前選項”的意思。
中文名
當前選項
外文名
current selection
簡    寫
SetCurSel
領    域
計算機

SetCurSel命令簡介

CComboBox::SetCurSel
在此處
int SetCurSel( int nSelect );

SetCurSel返回值

調用成功時返回選中的項的下標。如果 nSelect 大於列表中項的個數,則返回 CB_ERR 。如果 nSelect 為 -1 ,則清除當前的選擇並返回 CB_ERR 。

SetCurSel參數

nSelect
指定要選中的字符串的下標。如果為-1 ,則清除當前的選擇,編輯控件中的內容設置為空。

SetCurSel説明

本函數在組合框列表框中選擇一個字符串。必要時列表框會滾動,以使該字符串在列表的可視區內 (列表是可見的時 )。編輯控件中 的文本將相應地變為選中的字符串。此前在列表框中的選擇將不復存在。
CTabCtrl::SetCurSel
This method selects a tab in a tab control. A tab control does not send a TCN_SELCHANGING or TCN_SELCHANGE notification message when a tab is selected using this method. These notifications are sent, using WM_NOTIFY, when the user clicks or uses the keyboard to change tabs.
int SetCurSel( int nItem);ParametersnItemSpecifies the zero-based index of the item to be selected. Return Value
Zero-based index of the previously selected tab if it is successful; otherwise, it is –1.
Requirements
Windows CE versions:1.0 and later
Header file:Declared in Afxcmn.h