Easy one for you guys.
I have a textbox on top of a listbox.
The textbox is use to filter ther data in the listbox.
So... When the user type in the textbox, I would like to "trap" the down/up/pagedown/pageup keystrokes and fowarding them to the listbox.
I know I could use the Win32 API and send the WM_KeyDown message. But there's must be some .NET way to do this.
SendKeys.Send() Method.
Here is code through which you can select a list item.
In our wpf app we have a textbox that filters a listbox, we use the previewkeyup event. Inside the code, we can check what key was pressed (don't have my code in front of me, it's something like e.Key == Key.UpArrow, either way there's a built in class in C# for this). If it's one of the hot keys, we manipulate the user control accordingly.
For the listbox we tossed it into a user control and implemented an interface, called it NavigateableListbox or something like that, forced it to implement MoveUp(), MoveDown(), PageUp(), PageDown() etc so the textbox event just says if e.Key = Key.UpArrow { mylistbox.MoveUp() }
You can use Data Binding