Pelles C forum

C language => Beginner questions => Topic started by: David L Morris on August 25, 2010, 11:19:33 AM

Title: ListView Grid lines and full row select
Post by: David L Morris 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
Title: Re: ListView Grid lines and full row select
Post by: David L Morris 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
Title: Re: ListView Grid lines and full row select
Post by: TimoVJL on August 25, 2010, 12:12:20 PM
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;