CListBox::SetCurSel int SetCurSel( int nSelect );Return ValueLB_ERR if an error occurs.ParametersnSelectSpecifies the zero-based index of the string to be selected. If nSelect is –1, the list box is set to have no selection.ResSelects a string and scrolls it into view, if necessary. When the new string is selected, the list box removes the highlight from the previously selected string. Use this member function only with single-selection list boxes. It cannot be used to set or remove a selection in a multiple-selection list box.
属性里有一项是:always show select类似的话吧,打钩就好了 不行就ModifyStyle里加进去
int SetCurSel( int nSelect );Return ValueLB_ERR if an error occurs.ParametersnSelectSpecifies the zero-based index of the string to be selected. If nSelect is –1, the list box is set to have no selection.ResSelects a string and scrolls it into view, if necessary. When the new string is selected, the list box removes the highlight from the previously selected string. Use this member function only with single-selection list boxes. It cannot be used to set or remove a selection in a multiple-selection list box.
不行就ModifyStyle里加进去
m_clistctrl.SetItemState(nCurItem, LVIS_SELECTED, LVIS_SELECTED);
m_clistctrl.SetFocus();//要加上这一行
CListCtrl也可以这样用么?
CListCtrl 好像不能这样用哦