POSITION pos = m_myListCtrl.GetFirstSelectedItemPosition(); if (pos == NULL) { TRACE(_T("No items were selected!\n")); } else { while (pos) { int nItem = m_myListCtrl.GetNextSelectedItem(pos); TRACE(_T("Item %d was selected!\n"), nItem); // you could do your own processing on nItem here } }CListCtrl获得选中项,是这么用的.
是CListBox的单选列表框 不是CListCtrl int m_index=m_mylist.GetCurSel(); CString choose; m_mylist.GetText(m_index,choose); 这个对吗?
int m_index=m_mylist.GetCurSel(); CString choose; m_mylist.GetText(m_index,choose);对没错。 问题在数据库,搜索到的下标从 0 或 1起?
if (pos == NULL)
{
TRACE(_T("No items were selected!\n"));
}
else
{
while (pos)
{
int nItem = m_myListCtrl.GetNextSelectedItem(pos);
TRACE(_T("Item %d was selected!\n"), nItem);
// you could do your own processing on nItem here
}
}CListCtrl获得选中项,是这么用的.
int m_index=m_mylist.GetCurSel();
CString choose;
m_mylist.GetText(m_index,choose);
这个对吗?
CString choose;
m_mylist.GetText(m_index,choose);对没错。
问题在数据库,搜索到的下标从 0 或 1起?