Selection is gray in a CListCtrl
-
You can't. You'll have to find a Web site that will allow such. There are a ton of them out there that can act as a repository.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
-
Just to be safe, does explorer highlight in blue when you select a file? Its possible to have your "scheme" have the highlight color set to gray. As another thought, is your ListView (or ListCtrl) derived from anything, meaning did you use a class from an outside source? Just wondering if perhaps you or that class might be using NM_CUSTOMDRAW to override painting. Also, what styles are being used on the view, single selection, full-row selection, show selection always, owner data, owner draw? Personally I've never seen a basic ListCtrl ever paint incorrectly without some kind of interference from code.
-
Yes, Explorer highlights in blue, as it always has. Also, a TreeCtrl in my app which is a sibling of my ListCtrl selects correctly with a blue highlight.
Oh, um, are you using a manifest under VC6? I know when you use manifests (to get the XP style look), imagelists behave differently. I think, but not certain by any means, that the newer compilers handle this without problems, but I'm fairly sure VC6 won't. I've found CImageList won't work quite right, I had to use the macros like ImageList_Create for it to work right.
-
Oh, um, are you using a manifest under VC6? I know when you use manifests (to get the XP style look), imagelists behave differently. I think, but not certain by any means, that the newer compilers handle this without problems, but I'm fairly sure VC6 won't. I've found CImageList won't work quite right, I had to use the macros like ImageList_Create for it to work right.
-
VC7 has an option during project creation for including a manifest for C++ apps that defaults to "ON". Check your project or project/res directory for a .manifest file. If you have one, then its probably being used. Try turning it off.
-
VC7 has an option during project creation for including a manifest for C++ apps that defaults to "ON". Check your project or project/res directory for a .manifest file. If you have one, then its probably being used. Try turning it off.
How do I do that? My test app project has a manifest file, but my real project does not. With both projects exhibiting the same behavior, one has a manifest and the other does not, I can't believe that is the problem. Anyway, I can't find a setting in the project configuration for turning it on or off. I also searched the vcproj file for a hidden setting.
-
How do I do that? My test app project has a manifest file, but my real project does not. With both projects exhibiting the same behavior, one has a manifest and the other does not, I can't believe that is the problem. Anyway, I can't find a setting in the project configuration for turning it on or off. I also searched the vcproj file for a hidden setting.
Ah, sorry, too many different compilers/languages on my system. It'll be in the resources of the project, you'd have to delete it from there.
-
Ah, sorry, too many different compilers/languages on my system. It'll be in the resources of the project, you'd have to delete it from there.
-
Bummer. I'm fresh out of ideas. I'm sorry I couldn't figure it out for you. Hope something clicks and it works out.
-
Bummer. I'm fresh out of ideas. I'm sorry I couldn't figure it out for you. Hope something clicks and it works out.
-
Thanks, I appreciate your efforts on my behalf. When I get a fix, I will post it here. I have asked Microsoft for help on this one. Royce
I have found a fix for this problem, but I can't as yet explain why it works the way that it does. I am now creating my ListCtrl like so:
DWORD dwStyle = WS_CHILD | WS_TABSTOP; dwStyle |= LVS_ALIGNTOP | LVS_AUTOARRANGE | LVS_ICON | LVS_SHOWSELALWAYS | LVS_SINGLESEL; if ( bVisible ) dwStyle |= WS_VISIBLE; HWND hWnd = ::CreateWindow( "SysListView32", NULL, dwStyle, rcTree.left, rcTree.top, rcTree.Width(), rcTree.Height(), m_hWnd, NULL, AfxGetInstanceHandle(), NULL ); m_ctlComponents.Attach( hWnd );
Problem is fixed.