CListCtrl外有一个Button"Next",单击它CListCtrl中的项会下移,怎么样把置"NEXT"
后的那项设为高亮,以示它是当前被选中的项?

解决方案 »

  1.   

    m_wndList.SetFocus();
    m_wndList.SetItemState(2, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
    m_wndList.EnsureVisible(2, FALSE);
    ::SendMessage(m_wndList.m_hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);将第三行高亮显示
      

  2.   

    CListCtrl::SetSelectionMark
    int SetSelectionMark( int iIndex );Return ValueThe previous selection , or -1 if there was no selection .ParametersiIndexThe zero-based index of the first item in a multiple selection.ResThis member function implements the behavior of the Win32 macro,ListView_SetSelectionMark, as described in the Platform SDK.