CListrCtrl select item!!

SuperProgrammerUserandHacker
SuperProgrammerUserandHacker used Ask the Experts™
on
Hello,
 I Would like to know how from code to select CListCtrl item.
I use AllowSingleSelection and controls style is Report and ShowSelectionAllways. This control I have on dialog window.

I use visual studio .net 2002, visual c++.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
m_wndListCtrl.SetItemState(nListIndex, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);

Good LUck
OK, I will try it tomorrow.
:)
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

hi,
In Design time change the control styles as Single selection and Show selection always

use this function in coding for effective look
m_wndListCtrl.SetExtendedStyle(LVS_EX_FULLROWSELECT);



Hello,
 thank you roshmon, your code helped ME!
 thank you sreenu_v78 too, it looks good.
Hello,
 thank you roshmon, your code helped ME!
 thank you sreenu_v78 too, it looks good.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial