tags:

views:

21

answers:

1

I have a listbox with an ItemTemplate that displays a line of text in a TextBlock and a StackPanel containing some ToggleButtons.

If the user clicks on the TextBlock and then uses Up and Down arrow keys, the listbox behaves as it should. When the user clicks on the button and then presses Up and Down arrow keys, it is the button and not the list box that gets the keys so no scrolling occurs.

How do I tell the buttons not to handle the keys?

Andrew

+1  A: 

You could try to set the Button's Focusable property to false. This should prevent the button from receiving focus, and thus, from handling the key events.

gehho
Thanks you - Andrew
amaca
Glad it worked. Since this answer helped you, you should mark it as accepted by clicking on the checkmark on the left.
gehho