I tried creating a custom CheckedListBox and overriding the OnKeyUp, OnKeyPress, OnKeyDown, OnPreviewKeyDown methods but I couldn’t accomplish what I wanted to accomplish.
Essentially what is happening now is that if the user presses a key while the CheckedListBox has focus, the selected item changes. For example, if the user presses the up or down key, the next/previous item in the CheckedListBox is selected. if the user presses ‘A’, then the first item that begins with the letter ‘A’ is selected.
I want the CheckedListBox to behave in such a way that it is completely unresponsive to key presses (but still responsive to mouse clicks).
Can someone please tell me how to accomplish this?
I think it is possible to achieve this by inheriting from CheckedListBox and overriding it’s ProcessCmdKey() method to return true. That should ignore all commands.
I’ll give it a try in a solution and report back 🙂
Update:
It works.
Code I used:
A rebuild is required for the control to show up in Toolbox.