KeyDown event is not Working for Arrow keys ,Home , End ,Pageup,Pagedown and other similar keys in s

Posted by Subhen on Stack Overflow See other posts from Stack Overflow or by Subhen
Published on 2010-03-26T05:58:47Z Indexed on 2010/03/26 6:03 UTC
Read the original article Hit count: 147

Filed under:
|
|

Hi ,

I want to over ride the selection behaviour of listbox Items.

We can traverse through listbox items using Up and Down arrows where as I wan to traverse the list using Left and Right arrow keys.

While I am trying to add the key down event for Listbox, It shows almost all key presses except for Arrow Keys, Home, End and Similar keys.

I have the following Code:

private void listArtist_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key.ToString() == "Enter")
            {

                //Go to Some Page
            }
            else
            {
                MessageBox.Show(e.Key.ToString());
            }


        }

I am clue less about it. Please help.

Thanks, Subhen

© Stack Overflow or respective owner

Related posts about silverlight-3.0

Related posts about c#