Thread: ListView and checkboxes

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

    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,868
    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
    310
    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);

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