This is a really good point. The user may go crazy trying to click the down
arrow key when the control really does not have focus any longer. I think
the user can still have the visual that the item is selected.
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
The highlight is in gray if the control does not have the focus. The
highlight is in blue
if the control has the focus. This is very important to the user to know
the control has
the focus.
Note that if you leave the control highlighted in blue, the user will
assume that the
control HAS the focus, because that is how the control behaves; the number
of times I've
hit down-arrow to change a selection in a badly-designed control is far
too high; in fact,
I often build my own owner-draw CListBox just so I can get the gray
highlighting. If you
want the highlighting in blue, you must also SetFocus, which is usually a
Bad Idea because
focus is a concept owned by the user, and you should not mess with it
casually, or just
because you want to violate fundamental GUI behavior in a
counter-intuitive fashion.
joe
On Tue, 26 Aug 2008 01:59:09 -0700 (PDT), Kuenga <sagkumar@gmail.com>
wrote:
Hi,
I have a clistctrl. I am selecting the first entry in the list control
using the following:
SetItemState(0, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED |
LVIS_FOCUSED);
EnsureVisible(0, FALSE);
The item gets highlighted but in grey color. But when I select first
item in the list contrl using mouse, the item get highlighted using
blue color.
So wanted to know what setting I have to do go the blue color on item
being selected using the above code.
I have read the article at
http://www.codeproject.com/KB/list/selectentirerow.aspx.
Using OnDrawItem, I am getting the blue color but I need to write code
to handle the display of text also. Using OnDrawItem I am getting the
text to be overlapped.
So basically I want all the functionality which CListCtrl provides
except drawing the background of the items being selected. I want the
item to be selected in blue color and I donot think it is good idea to
write so much code for that.
Thanks
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm