(list box control), CListBox, , (item) . , , , . , , . , , 볺 (owner-drawn list box control), 3, . , , (list view control), 7, " ".
, ControlsDcmo IDD_LISTBOX. , CDialog, ' CListBoxDlg. ( Controls) , 䳿 , CListBoxDlg, .
, , , ' , Controls Demo.
, , . CListBox 䳺 -: AddString InsertString.
AddString , . ( LBS_SORT Sort}, 0 , . () . int CListBox::AddString(LPCTSTR value);
InsertString . ( ) , , . , . , InsertString , , . AddString, InsertString , .
int CListBox::InsertString(int index, LPCTSTR value);
, , CListBox::DeleteString, , . , .
|
|
, CListBox::ResetContent
- CListBox LB_ERR. , .
CListBox 䳺 , , , . , , GetCurSel, ( ) , . , GetCurSel LB_ERR.
, , SetCurSel, , . SetCurSel -1.
SelectString.
int SelectString(int nStartAfter, LPCTSTR lpszltem);
, SelectString . , nStartAfter, , . -1. , lpszltem, , , . , . 10.13, Jean Vaijean ( ), , ( , nStartAfter ), "J".
m_lbx.SelectString(2,"J");
, , FindString FindStringExact. FindString SelectString, , FindStringExact . LB_ERR, .
, , -. SetSel, SelltemRange. ':
m_ListBoxl.SetSel(5);
m_ListBoxl.SelltemRange{TRUE,7,12);
m_ListBoxl.SelltemRange(FALSE,1,4);
' , .