NO

Author Topic: ListView Grid lines and full row select  (Read 4521 times)

David L Morris

  • Guest
ListView Grid lines and full row select
« on: August 25, 2010, 11:19:33 AM »
Hi there. I am trying to convert some code that I used successfully in another language and would appreciate any help on this code.  The project compiles and runs OK but no grid lines or full row select are displayed.

         //Adjust the ListView to show grid rows
   int lStyle;
        lStyle = SendMessage(hWndLV, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
    SendMessage(hWndLV,LVM_SETEXTENDEDLISTVIEWSTYLE,
                  lStyle | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES, 0);

Thanks
David

David L Morris

  • Guest
Re: ListView Grid lines and full row select
« Reply #1 on: August 25, 2010, 11:41:50 AM »
Seem change to the following line fixed it to display correctly:-

    SendMessage(hWndLV,LVM_SETEXTENDEDLISTVIEWSTYLE, 0,
                  lStyle | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);

Hope it helps others
David

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: ListView Grid lines and full row select
« Reply #2 on: August 25, 2010, 12:12:20 PM »
I use it this way:
Code: [Select]
SendMessage(hWndLV, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_GRIDLINES, LVS_EX_GRIDLINES);
Code: [Select]
SendMessage(hWndLV, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
LVM_SETEXTENDEDLISTVIEWSTYLE
    wParam = (WPARAM)dwExMask;
    lParam = (LPARAM)dwExStyle;
May the source be with you