开发者

Does LVS_EX_FULLROWSELECT have any compatibility issues with other styles?

I am trying to set the LVS_EX_FULLROWSELECT style on my grid list control as I want full row selection. However apparently it doesn't have any effect. Since I am using a number of other styles as well, I am wondering if LVS_EX_FULLROWSELECT has any compatibility issues with other styles. Anyone? Following are the styles I am setting.

Initially following styles are set on base list control class:

WS_CHILD|WS_BORDER|LVS_REPORT|LVS_SHOWSELALWAYS|LVS_SINGLESEL

Then I try to set additional styles in the derived grid list control class:

ListView_SetExtendedListViewStyleEx(sy开发者_如何学运维sId(), 0, LVS_EX_GRIDLINES | LVS_OWNERDATA | LVS_EX_FULLROWSELECT);


The second parameter is a mask, so you need:

ListView_SetExtendedListViewStyleEx(m_hWnd, LVS_EX_GRIDLINES | LVS_OWNERDATA | LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES | LVS_OWNERDATA | LVS_EX_FULLROWSELECT);


You need to send the LVM_SETEXTENDEDLISTVIEWSTYLE message to the control and specify the LVS_EX_FULLROWSELECT extended style (source: MS Support).

Edit:

Check the example. There is

ListView_SetExtendedListViewStyle(m_hWnd, ListView_GetExtendedListViewStyle(m_hWnd), VS_EX_FULLROWSELECT);

Try using ListView_GetExtendedListViewStyle(sysId()) instead of 0. BTW - does this sysId() of yours really retrieve the window handle? The name sounds somewhat different.

Cheers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜