We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Stop PgDw key from affecting combo box

davidb
davidb asked
on
Medium Priority
211 Views
Last Modified: 2006-11-17
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
Comment
Watch Question

CERTIFIED EXPERT
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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

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
CERTIFIED EXPERT

Commented:
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.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.