Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CListCtrl - Why is selection gray

801 views
Skip to first unread message

Abraham Mathew

unread,
Jun 11, 1998, 3:00:00 AM6/11/98
to

I have a list control created with the LVS_SHOWSELALWAYS flag.
When I SetItemState of any of the items to SELECTED, the items get
highlighted in Gray if the list control does not have focus. But if the
list control does have focus, it is highlighted in Blue. Any idea why, and
how to always make it look Blue?

Andy Duplain

unread,
Jun 12, 1998, 3:00:00 AM6/12/98
to

Isn't that what you'd expect ? The blue/gray is just as the
activate/inactive title bar of a window would behave. It is simply relating
the fact that the item is selected but the window doesn't have focus. If
you don't want this you could simply remove LVS_SHOWSELALWAYS. If you want
it to look blue all the time you could change your desktop settings so the
inactive title bar is the same as the active title bar 8-(

--
Andy Duplain, Syntegra, Brighton, UK.
===> When mailing me, change "nospam" to "syntegra" <===

Abraham Mathew wrote in message <6lpd75$82c$1...@brokaw.wa.com>...

David Lowndes

unread,
Jun 12, 1998, 3:00:00 AM6/12/98
to

>The blue/gray is just as the
>activate/inactive title bar of a window would behave...

>If you want
>it to look blue all the time you could change your desktop settings so the
>inactive title bar is the same as the active title bar 8-(

It seems to be fixed as grey - it doesn't change if you alter the
inactive title bar colour! Maybe it uses another setting?

Dave
----
Address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow up email copies.
http://www.bj.co.uk

Agent

unread,
Jun 15, 1998, 3:00:00 AM6/15/98
to

David Lowndes wrote in message <359620b7.16117986@sparcone>...

>It seems to be fixed as grey - it doesn't change if you alter the
>inactive title bar colour! Maybe it uses another setting?


Perhaps it uses inactive window border.
I myself don't like that gray look, nor do I want the focus to vanish
all the time. After all, list boxes don't do that.

It turns gray when the control receives the WM_KILLFOCUS message. I've
tried to custom-draw it away, but that doesn't work. The only way I
could keep it blue was with a custom WM_KILLFOCUS handler. The handler
gets rid of the focus rectangle with SetItemState, but does *not* call
CListCtrl::OnKillFocus.

-- Agent

Howard Rubin - change nospam to nyx

unread,
Jun 18, 1998, 3:00:00 AM6/18/98
to

"Abraham Mathew" <abra...@visio.com> wrote:
>I have a list control created with the LVS_SHOWSELALWAYS flag.
>When I SetItemState of any of the items to SELECTED, the items get
>highlighted in Gray if the list control does not have focus. But if the
>list control does have focus, it is highlighted in Blue. Any idea why, and
>how to always make it look Blue?

If you don't want to muck with your desktop color scheme, you can
make the listbox owner-draw. The CCheckListBox code is a good example
of how to do this.
HTH, Howard Rubin
--
Advertisers using spambots, please don't send to the following addresses:
pres...@whitehouse.gov vice.pr...@whitehouse.gov first...@whitehouse.gov consum...@ftc.gov c...@ftc.gov fr...@uspis.gov u...@ftc.gov rh...@fcc.gov jqu...@fcc.gov sn...@fcc.gov rch...@fcc.gov cust...@usps.gov ad...@HARRIS-MARKETING.COM postm...@HARRIS-MARKETING.COM jmo...@SAVOYNET.COM postm...@agis.net ab...@agis.net ro...@agis.net dns-...@AGIS.NET n...@AGIS.NET hostm...@agis.net pat.co...@state.co.us ph...@agis.net webm...@agis.net postm...@cyberamish.com ab...@cyberamish.com ro...@cyberamish.com postmaster@localhost postm...@tsf-marketing.com ab...@tsf-marketing.com ro...@tsf-marketing.com postm...@TSF-INDUSTRIES.COM ab...@TSF-INDUSTRIES.COM ro...@TSF-INDUSTRIES.COM in...@tsf-industries.com
st...@quantcom.com wa...@pwr.net au...@mci.savetrees.com postm...@answerme.cybermirror1.com postm...@ispam.net pri...@answerme.cybermirror1.com priv...@answerme.com priv...@answerme.cybermirror1.com priv...@mci.savetrees.com priv...@spamford.com ro...@answerme.cybermirror1.com st...@mci.savetrees.com sta...@mci.savetrees.com wal...@answerme.cybermirror1.com wal...@auto3.cybermirror1.com wal...@ispam.net wal...@mci.savetrees.com wal...@temp.cyberpromo.com docu...@agis.net ip-re...@agis.net rou...@agis.net ne...@agis.net accou...@agis.net in...@agis.net aa...@agis.net h...@agis.net ema...@qlink2info.com sim...@answerme.com off...@savetrees.com postm...@inreach.com ab...@inreach.com ro...@inreach.com hostm...@INREACH.COM a...@INREACH.COM postm...@EMAILDIRECT.NET ab...@EMAILDIRECT.NET ro...@EMAILDIRECT.NET postm...@e-bizness.com ab...@e-bizness.com ro...@e-bizness.com com...@IAW.ON.CA maxe...@UNITED-CBE.ORG dom...@EMAILDIRECT.NET

0 new messages