We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Intercept listbox key behavior

Thread ID:





2831 Feb 16,2003 04:10 PM UTC Feb 19,2003 11:30 AM UTC WinForms 3
Tags: FAQ
David Whatley
Asked On February 16, 2003 04:10 PM UTC

When a listbox control has focus and a a key is pressed, it tries to select the item that matches that keystroke. I'd like to have it not do this at all in one particular place, but I cannot figure out how. Is there an easy way to disable this behavior. I tried wiring to the keydown event (and doing nothing with it), but that doesn't seem to help. I'm sure it's simple... just not seeing it. :) - David

Administrator [Syncfusion]
Replied On February 17, 2003 12:34 PM UTC

The listbox control probably does this in it's OnKeyDown method (before firing the KeyDown event) or in ProcessCmdKey method. Try overriding OnKeyDown and not call the base class in a derived class, this will prevent all keydown processing in the listbox control. If that doesn't work try overriding ProcessCmdKey. -Praveen

Replied On February 17, 2003 07:23 PM UTC

You mean I have to create my own control type by inheriting from one of theirs? -- David

Ramesh Praveen [Syncfusion]
Replied On February 19, 2003 11:30 AM UTC

Yes, that is what I meant. -Praveen


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon