Solved

Stop PgDw key from affecting combo box

Posted on 1997-06-30
3
148 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
0
Comment
Question by:davidb
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
tward earned 100 total points
ID: 1427899
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
 

Author Comment

by:davidb
ID: 1427900
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
 
LVL 7

Expert Comment

by:tward
ID: 1427901
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Visual Basic Excel Formatting error 4 83
MsgBox 2 47
Sending a email via excel using vba 6 72
Notepad++ how to remove delimiter : from beggning of the line? 3 94
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now