I have a listbox control in a windows app and I want to disable the default right and left arrow keydown event triggers. Currently when you press right or left arrows the selected item travels up and down the listbox. I want to add my own actions.
Share
Try adding an event handler to the
ListBox.KeyDownevent. If the key pressed is an arrow key, set theHandledflag of theKeyPressEventArgstotrueto prevent further processing.A code example, based on an MSDN Forum post