同上
只要这一部分的代码

解决方案 »

  1.   

    我记得好像已经有一个CCheckListBox的类,你找找看
      

  2.   

    看下面的例子http://www.codeproject.com/listctrl/xlistctrl.asp
      

  3.   

    CListCtrl::SetExtendedStyle
    DWORD SetExtendedStyle( DWORD dwNewStyle );
    LVS_EX_CHECKBOXES  Version 4.70. Enables check boxes for items in a list view control. Effectively, when set to this style, the control will create and set a state image list usingDrawFrameControl. Check boxes are visible and functional with all list view modes. The state of the check box for a given item is obtained using the ListView_GetCheckState macro. 
    Note: To set the state of the item checkbox, use the following macro. #ifndef ListView_SetCheckState
       #define ListView_SetCheckState(hwndLV, i, fCheck) \
          ListView_SetItemState(hwndLV, i, \
          INDEXTOSTATEIMAGEMASK((fCheck)+1), LVIS_STATEIMAGEMASK)
    #endif
     
    LVS_EX_FLATSB  Version 4.71. Enables flat scroll bars in the list view. If you need more control over the appearance of the list view's scroll bars, you should manipulate the list view's scroll bars directly using the Flat Scroll Bar APIs.  
    LVS_EX_FULLROWSELECT  Version 4.70. When an item is selected, the item and all its subitems are highlighted. This style is available only in conjunction with the LVS_REPORT style.  
    LVS_EX_GRIDLINES  Version 4.70. Displays gridlines around items and subitems. This style is available only in conjunction with the LVS_REPORT style.  
    LVS_EX_HEADERDRAGDROP  Version 4.70. Enables drag-and-drop reordering of columns in a list view control. This style is only available to list view controls that use the LVS_REPORT style.  
    LVS_EX_INFOTIP  Version 4.71. The list view control sends an LVN_GETINFOTIP notification message to the parent window before displaying an item's tooltip. This style is only available to list view controls that use the LVS_ICON style.  
    LVS_EX_MULTIWORKAREAS  Version 4.71. If the list view control has the LVS_AUTOARRANGE style, the control will not autoarrange its icons until one or more work areas are defined (see LVM_SETWORKAREAS). To be effective, this style must be set before any work areas are defined and any items have been added to the control.  
    LVS_EX_ONECLICKACTIVATE  Version 4.70. The list view control sends an LVN_ITEMACTIVATE notification message to the parent window when the user clicks an item. This style also enables hot tracking in the list view control. Hot tracking means that when the cursor moves over an item, it is highlighted but not selected.  
    LVS_EX_REGIONAL  Version 4.71. The list view will create a region that includes only the item icons and text and set its window region to that usingSetWindowRgn. This will exclude any area that is not part of an item from the window region. This style is only available to list view controls that use the LVS_ICON style.  
    LVS_EX_SUBITEMIMAGES  Version 4.70. Allows images to be displayed for subitems. This style is available only in conjunction with the LVS_REPORT style.  
    LVS_EX_TRACKSELECT  Version 4.70. Enables hover selection in a list view control. Hover selection (also called track selection) means that an item is automatically selected when the cursor remains over the item for a certain period of time. The delay can be changed from the default system setting with the LVM_SETHOVERTIME message. This style applies to all styles of list view control.  
    LVS_EX_TWOCLICKACTIVATE     Version 4.70. The list view control sends an LVN_ITEMACTIVATE notification message to the parent window when the user double-clicks an item. This style also enables hot tracking in the list view control. Hot tracking means that when the cursor moves over an item, it is highlighted but not selected.  
    LVS_EX_UNDERLINECOLD  Version 4.71. Causes nonhot items to be displayed with underlined text. This style is ignored if LVS_EX_ONECLICKACTIVATE is not set.  
    LVS_EX_UNDERLINEHOT  Version 4.71. Causes hot items to be displayed with underlined text. This style is ignored if LVS_EX_ONECLICKACTIVATE or LVS_EX_TWOCLICKACTIVATE is not set.  
      

  4.   

    m_lcColumnCustom.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_INFOTIP | 
    LVS_EX_CHECKBOXES);
      

  5.   

    Earthdog(Earthdog) 说的方法是可行的:)
      

  6.   

    这个的结果是在每一行的最前面加上一个checkbox。
      

  7.   

    楼上说得很对。但是,能不能在前面不加checkbox,而是加上个radiobutton ?不知道有没有人会?
      

  8.   

    m_list.InsertItem()
    And 
    m_list.SetItemText(int indexItem,int nSubItem,"")