Up and Down Arrow Keys in a Listview control

BulletSponge

New member
Joined
Jun 28, 2005
Messages
3
Programming Experience
3-5
I've got a custom listview control that is filtered based on several methods. The filtering works great, but the UP, DOWN, Page Up, and Page Down keys function differently depending on whether or not I used the mouse to click on the listview control or one of it's items.

When I set the focus to the Listview through code like MyListView.Focus (includes selecting the correct item and selecting it), pressing the Up or Down keys scrolls the ENTIRE listview.
When I CLICK on the listview control with the mouse, and I press the Up or Down keys, scrolls Item by Item, selecting the next or previous item as I go.

The desired navigation is to use Item by Item selection, NOT use the listview scrollbar, so how do I set a control to navigate this way through code?
 
umm i think you can use the Key Down and Key Up events and based on which key pressed you can select that item :

Example :

If e.KeyCode=Keys.PageDown Then

listView.Items.Item(indexOfLastItem).Selected=True

End If

and same for all

If i help let me know or you means something else?
 
Nope,

The only Key related events that capture the UP & DOWN ARROW keys and the PAGE UP & DOWN keys is the System Key press event.

Is there a an API call that sets the focus to an ACTIVE X control and tells the system to use the arrow keys to control it's functions rather than navigate like the tab button?

If the Control is a standard Visual Studio .Net control, the arrow keys work just fine like I want... but Active X controls don't work in the same fashion...

This has become VERY frustrating
 
Back
Top