Hello
I want to change the color which appears when i select an item from a CListCtrl control .Does anyone know give a link or a sample with something like this?
Thanks
All you have to do is to modify member function Create:
BOOL CListCtrl.Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );
dwStyle :
LVS_SHOWSELALWAYS - Always show the selection, if any, even if the control does not have the focus
and
LVS_SINGLESEL - Allows only one item at a time to be selected. By default, multiple items can be selected
For Doc/View You can try:
BOOL CAplView:reCreateWindow(CREATESTRUCT& cs)
{
// default processing
BOOL bReturn = CListView:reCreateWindow(cs);
// the list is in report mode by default
cs.style |= LVS_REPORT;
// the list is single selection only
cs.style |= LVS_SINGLESEL;
// the selected item stays in the selected color even
// if the list view loses focus
cs.style |= LVS_SHOWSELALWAYS;
return bReturn;
}
If you want more help please read MSDN Lib on your install CD.
I think that you can't do what you want, but there is a way
just make your view class derivate from CView and create all functions you need. Sorry i can't halp you with enything more.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.