CListCtrl Row Highlight disappears when control loses focus 
Author Message
 CListCtrl Row Highlight disappears when control loses focus

Hi -
I'm trying to use a CListCtrl to show a list of items that the user can
singly or multiply select from.  The problem I am having is that when
the user highlights the row(s) they want, if the user clicks on another
control on the screen, the list control loses the focus and the
highlighting is no longer visible to the user. Their first reaction is
that the rows are no longer selected.  (But they still are, it's just
no longer visible).

Does anyone know how to fix this problem so that the rows the user
highlights in a control list stay visibly selected when the user clicks
elsewhere on the app screen?

Thanks,
Jen Studer

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Mon, 17 Mar 2003 03:00:00 GMT  
 CListCtrl Row Highlight disappears when control loses focus
You can set the list control to always show the selection when it doesn't
have focus.   Either check the "Show selection always" box in the resource
editor or if your creating the control dynamically, specify the
LVS_SHOWSELALWAYS style.

Stu


Quote:
> Hi -
> I'm trying to use a CListCtrl to show a list of items that the user can
> singly or multiply select from.  The problem I am having is that when
> the user highlights the row(s) they want, if the user clicks on another
> control on the screen, the list control loses the focus and the
> highlighting is no longer visible to the user. Their first reaction is
> that the rows are no longer selected.  (But they still are, it's just
> no longer visible).

> Does anyone know how to fix this problem so that the rows the user
> highlights in a control list stay visibly selected when the user clicks
> elsewhere on the app screen?

> Thanks,
> Jen Studer

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Mon, 17 Mar 2003 03:00:00 GMT  
 CListCtrl Row Highlight disappears when control loses focus
Thanks -
The Show Selection Always box worked - can't believe I missed it.  I
tried first to just use LVS_SHOWSELALWAYS via the SendMessage method,
but that didn't work.  Not sure why, but since I got this baby to work
via one method it doesn't really matter.

Thanks for your help -
I really appreciate.
Jen Studer



Quote:
> You can set the list control to always show the selection when it
doesn't
> have focus.   Either check the "Show selection always" box in the
resource
> editor or if your creating the control dynamically, specify the
> LVS_SHOWSELALWAYS style.

> Stu



> > Hi -
> > I'm trying to use a CListCtrl to show a list of items that the user
can
> > singly or multiply select from.  The problem I am having is that
when
> > the user highlights the row(s) they want, if the user clicks on
another
> > control on the screen, the list control loses the focus and the
> > highlighting is no longer visible to the user. Their first reaction
is
> > that the rows are no longer selected.  (But they still are, it's
just
> > no longer visible).

> > Does anyone know how to fix this problem so that the rows the user
> > highlights in a control list stay visibly selected when the user
clicks
> > elsewhere on the app screen?

> > Thanks,
> > Jen Studer

> > Sent via Deja.com http://www.deja.com/
> > Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Mon, 17 Mar 2003 03:00:00 GMT  
 CListCtrl Row Highlight disappears when control loses focus
LVS_SHOWSELALWAYS isn't a message .. that is why sending it didn't work.

It is a style bit.  You need to modify the style of the listcontrol and add
in this value.

eg. ModifyStyle(0,LVS_SHOWSELALWAYS);

Roger

Quote:

> Thanks -
> The Show Selection Always box worked - can't believe I missed it.  I
> tried first to just use LVS_SHOWSELALWAYS via the SendMessage method,
> but that didn't work.  Not sure why, but since I got this baby to work
> via one method it doesn't really matter.

> Thanks for your help -
> I really appreciate.
> Jen Studer



> > You can set the list control to always show the selection when it
> doesn't
> > have focus.   Either check the "Show selection always" box in the
> resource
> > editor or if your creating the control dynamically, specify the
> > LVS_SHOWSELALWAYS style.

> > Stu



> > > Hi -
> > > I'm trying to use a CListCtrl to show a list of items that the user
> can
> > > singly or multiply select from.  The problem I am having is that
> when
> > > the user highlights the row(s) they want, if the user clicks on
> another
> > > control on the screen, the list control loses the focus and the
> > > highlighting is no longer visible to the user. Their first reaction
> is
> > > that the rows are no longer selected.  (But they still are, it's
> just
> > > no longer visible).

> > > Does anyone know how to fix this problem so that the rows the user
> > > highlights in a control list stay visibly selected when the user
> clicks
> > > elsewhere on the app screen?

> > > Thanks,
> > > Jen Studer

> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Tue, 18 Mar 2003 07:29:08 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. CListCtrl: The List Control de-highlights when the control loses focus

2. CListCtrl - highlight item after losing focus?

3. CListCtrl not maintaining highlight after deleting previous row

4. CListCtrl and Row highlighting

5. CListCtrl - How to select / highlight a row in Listctrl view

6. Highlight a complete row in CListCtrl

7. Programatically Highlighting A Row In A CListCtrl

8. CListCtrl - Highlight a row

9. Help: Highlight the whole row of a CListCtrl

10. Select (or highlight) the whole row in the CListCtrl

11. Highlight first row of a CListCtrl?

12. CListCtrl and entire row highlighting.

 

 
Powered by phpBB® Forum Software