ListView and checkboxes

This is a discussion on ListView and checkboxes within the Windows Programming forums, part of the Platform Specific Boards category; I just discovered LVS_EX_CHECKBOXES but I need a checkbox as Subitem in the ListView... Does anyone know how? Thanks...

  1. #1
    Registered User Joelito's Avatar
    Join Date
    Mar 2005
    Location
    Tijuana, BC, México
    Posts
    308

    ListView and checkboxes

    I just discovered LVS_EX_CHECKBOXES but I need a checkbox as Subitem in the ListView...

    Does anyone know how?

    Thanks
    * PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
    * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    something like

    DWORD exStyles = LVS_EX_CHECKBOXES;

    //MFC
    List.SetExtendedStyle(exStyles);

    //WIN32
    ListView_SetExtendedListViewStyle(hWndLV,exStyle);

    or

    SendMessage( hWndLV, LVM_SETEXTENDEDLISTVIEWSTYLE, (WPARAM)exStyle,(LPARAM)exStyle);
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Registered User Joelito's Avatar
    Join Date
    Mar 2005
    Location
    Tijuana, BC, México
    Posts
    308
    I part that already know, thanks

    But I discovered ListView_GetSubItemRect and seems I way to do it...

    Thanks!
    * PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
    * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    If you're trying to change the column that the checkbox appears in, you can use ListView_SetColumnOrderArray:
    Code:
            int order[] = { 2, 0, 1, 3 };
    	ListView_SetColumnOrderArray(hListView, 4, order);
    Attached Images Attached Images  

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. add button to listview
    By Thoth in forum Windows Programming
    Replies: 4
    Last Post: 06-12-2007, 10:43 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21