CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Oct 2005

    Help with CListBox Multi-column with checkbox

    Hi All,

    Firstly I've managed to put together a mockup image of what I'm after, it's attached and what I have with code so far is below.

    I'm not particlurly fluent in C++ but a fast learner. The following is what I am attempting to achieve:
    1. I'm trying to create this multiple column List with checkboxes in the second column of the items.
    2. Where the second column heading is I'd like to place a image instead of text.
    3. How to check these boxes.
    4. How to disable the boxes.

    Any help is greatly appreciated!

    //******Somehow here insert column heading with image *******
    //m_myListControl.InsertColumn(2,??An image??LVCFMT_LEFT,50);

    CString strText;

    // Insert 10 items in the list view control.
    for (int i=0;i < 10;i++)
    m_myListControl.InsertItem(LVIF_TEXT|LVIF_STATE, i, "Layer Title", 0, 0, 0, 0);
    //*******here somehow add a checkbox on the second column******
    m_myListControl.SetItemText(i, 1, "CHECKBOX");
    m_myListControl.SetItemText(i, 2, "'WS Point: '+AssetType");
    m_myListControl.SetItemText(i, 3, "(0, 10000)");

    //*******On the 5th item check checkbox and disable it******
    if (i = 4)
    //I know this isn't right but hopefully you'll see what mean
    Attached Images Attached Images  
    Last edited by ill_comms; March 16th, 2009 at 09:48 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.