Click to See Complete Forum and Search --> : CListCtrl and "Full Row Select" ...


craig knutson
May 5th, 1999, 10:33 AM
... i was looking through some of the examples out here and i noticed one that talked about:
LVS_EX_FULLROWSELECT

to do full row select in my listctrls i've been using an example that i think i found in the microsoft knowledge base a long time ago. it seems to do the trick, but i thought that if they now support it as an option i would rather do it that way.

so i tried to try this out, but my create fails.

here is the create statement i'm using.


m_listctrlParams = new CobolJclgenListctrl_params;
m_listctrlParams->CreateEx(
WS_EX_CLIENTEDGE // Ex Style
,WC_LISTVIEW // Class Name
,NULL // Window Name
,WS_CHILD // style
| WS_BORDER
| WS_VISIBLE
| LVS_REPORT // implies a sortable header
| LVS_ALIGNLEFT
| LVS_EDITLABELS
| LVS_OWNERDRAWFIXED
| LVS_EDITLABELS // to support "edit cells"
| LVS_EX_FULLROWSELECT
,rect.left // left
,rect.top // top
,rect.right // width
,rect.bottom // height
,this->GetSafeHwnd() // parent window
,NULL // ptr to param
);




is this the way it should be used?

maybe my problem is that i'm still on VC 5.0 and this is a 6.0 feature?

thanks for any info you can provide.

craigk
cknutson@flash.net

BrianOG
May 5th, 1999, 10:39 AM
It is an extended style so you must use CListCtrl::SetExtendedStyle to set it.

craig knutson
May 5th, 1999, 02:02 PM
as it turns out you actually need to use:

ListView_SetExtendedListViewStyle(
m_plistctrl->m_hWnd
,LVS_EX_FULLROWSELECT
);




thanks for getting me on the right track though.

craigk
cknutson@flash.net