CListCtrl::SetExtendedStyle( LVS_EX_FULLROWSELECT );

解决方案 »

  1.   

    先要设置LIST的SELECTION属性为MULTIPLE
    然后用代码SelItemRange(true,first,last);来选中所有项。
    用GetSelCount可以获得list中的项的个数。
      

  2.   

    看错了。。是全选,给你个函数/****************************************************
    ** @Description
    ** Select All item .
    **
    ** @Parameter
    **
    **
    ** @Return:
    ** @Author: Table.JHM.太子
    ** e-mail: [email protected]
    ** @Date: 2001 3 26
    ****************************************************/
    BOOL CJobListCtrl::SelectAllItem()
    {
    int iCount = GetItemCount( ) ;
    if( iCount == 0  )
    return true ; for( int i = 0 ; i < iCount ; i ++ )
    {
    SetItemState( i , LVIS_SELECTED  , LVIS_SELECTED  ) ;
    }
    return true ;
    }
      

  3.   

    编程逐个设置为选中状态setitem LVIF_STATE LVIS_SELECTED