Stop PgDw key from affecting combo box

I am using a video soft view port and am using the following code to scroll the page with the page up and page down buttons

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case &H21: vsViewPort1.VirtualTop = vsViewPort1.VirtualTop - 5000
Case &H22: vsViewPort1.VirtualTop = vsViewPort1.VirtualTop + 5000
End Select
End Sub


This works fine except when a combo box is in focus. Pushing page down not only scowls the page but also has the undesirable affect of changing the selection in the combo box. Is there any way to stop the selection from changing in the combo box?

David
davidbAsked:
Who is Participating?
 
twardConnect With a Mentor Commented:
Try on the COMBO1_KEYDOWN to set the Keycode = 0.  This is the way I eat up certain key strokes in the KEYPRESS Event.
0
 
davidbAuthor Commented:
I forgot to mention that I would like to have the up and down arrow keys move the como box selections but not the page up and down keys. Any thing that will do this?

David
0
 
twardCommented:
Only thing I can think of is when you trap keys trap the Left and Right Arrows and change the Keycode to be the keycode of the PAGEDOWN key.
0
All Courses

From novice to tech pro — start learning today.