STEP1:
void CRepeatMP3Dlg::iniListBox(CListCtrl *p_List)
{
p_List->InsertColumn(0,"",LVCFMT_LEFT,0); // Line1
p_List->InsertColumn(1,TEXT(""),LVCFMT_CENTER, 30); // Line2
p_List->InsertColumn(2,TEXT("File Name"),LVCFMT_LEFT,550); //3
p_List->InsertColumn(3,TEXT("Play Time"),LVCFMT_CENTER,100); //3
DWORD dwStyle = p_List->GetExtendedStyle();
dwStyle|=LVS_EX_FULLROWSELECT;
dwStyle|=LVS_EX_GRIDLINES;
dwStyle|=LVS_EX_CHECKBOXES;
p_List->SetExtendedStyle(dwStyle);
// p_List->SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP);//选中整行
}
STEP2:
m_list.SetFocus();
m_list.SetItemState(m_iSelectedListLineIndex, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
m_list.EnsureVisible(m_iSelectedListLineIndex, FALSE);
STEP3:
设置CListCtrl的属性里Single Select 和 Alway Select
THE UP CODE TEST OK!!!