ListView Grid lines and full row select

Started by David L Morris, August 25, 2010, 11:19:33 AM

Previous topic - Next topic

David L Morris

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

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

TimoVJL

I use it this way:
SendMessage(hWndLV, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_GRIDLINES, LVS_EX_GRIDLINES);

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