15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CListCtrl Focus Highlighting

Lance Lovette -- lovette@iftech.com
Tuesday, February 20, 1996

When a list view control loses focus, the highlight from the currently
selected item is removed, so even though an item is selected, you can't
tell until you give focus back to the control.  In a normal list box the
selected item keeps its highlight.  Is there a way to get the list view
control to do the same without making it owner-drawn?  If not, has anyone
already solved this problem who would like to share the answer?

Thanks,

Lance Lovette
lovette@iftech.com

+-----------------------------------------------------------------------------+
| Interface Technologies, Inc.
| Software Design & Programmer Training
|
| For a collection of free tutorials covering a variety of programming and   
| computer-related topics such as Visual C++, MFC, and Windows NT check out
| the ITI On-line Training Center at http://www.iftech.com.
+-----------------------------------------------------------------------------+



Alok Khanna -- alok@clarit.com
Wednesday, February 21, 1996

>When a list view control loses focus, the highlight from the currently
>selected item is removed, so even though an item is selected, you can't
>tell until you give focus back to the control.  In a normal list box the
>selected item keeps its highlight.  Is there a way to get the list view
>control to do the same without making it owner-drawn?  If not, has anyone
>already solved this problem who would like to share the answer?

Well this is an undocumented thingy. Use flag LVS_SHOWSELALWAYS during
Create. 

dwStyle |=  LVS_SHOWSELALWAYS | other flags

[Moderator's Note: This is documented in VC++ 4.0.]

Good luck,

Alok Khanna
alok@clarit.com
CLARITECH Corporation




| Вернуться в корень Архива |