我在Cformview中用了CListBox 在这个里面我用了一个叫 ON_LBN_SETFOCUS(IDC_LIST1, OnSetfocusList1)void CCode1::OnSetfocusList1() { m_listBox.SetFocus(); m_listBox.SetCurSel(clist); }这样一用就是运行的时候出错
SetCurSel()函数里面的参数不是序号吗?int SetCurSel( int nSelect );
Return Value
LB_ERR if an error occurs.
Parameters
nSelect
Specifies the zero-based index of the string to be selected. If nSelect is –1, the list box is set to have no selection.