Click here to Skip to main content
15,922,015 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one ClistCtrl in my dialog. I have the shortcut keys for the various functionalities. But when the focus is on the CList ctrl , the selected file gets changed if i press any alphabet. Suppose selection is on Washington and if i pressed key "I" for inserting the file washington, my selection gets changed in CListCtrl and it will select an row with starting I like INDIA... i want to stop this auto selection... can u suggest me the right way to do so... thanks in advance
Posted

Not sure this will work, just a suggestion: can't you override the keyboard event handlers: OnChar, OnKeyDown, OnKeyUp... for this control ?
 
Share this answer
 
v2
Comments
gopal.ambhore 9-Aug-11 2:55am    
I have already used the OnKeyUp method to handle my shortcut in the Dilaog. Is there any way to stop the auto selection of the rows like auto arrangement in ascending and decending order?
YvesDaoust 9-Aug-11 3:04am    
I don't know.

If I were you, I would try overriding all the keyboard-related handlers.
I think you can handle this situation using PreTranslateMessage in your dialog box

C#
if(pMsg->hwnd == m_MyList.GetSafeHwnd())
{
    if(pMsg->message == WM_KEYDOWN)
    {
            //you will enter here when the key is pressed on list control
    }
}
 
Share this answer
 
Comments
gopal.ambhore 9-Aug-11 5:23am    
Hey Thanks.. it worked :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900