Solved

F10 function key

Posted on 2004-04-03
4
1,329 Views
Last Modified: 2008-03-06
Hi,

I have a VB prog with a menu.
I can assignt F5 to F12 shortcuts
to different menu item EXCEPT F10.

F10 is not shown in the shortcut
list of menu editor. How do I correct this.

I am using VB6 with service pack 5.

Thanks for your help
0
Comment
Question by:aftab2003
  • 2
4 Comments
 
LVL 11

Expert Comment

by:bingie
ID: 10749214
It is not listed because F10 is a system windows key for activating the main toolbar, i.e. File, Edit, View...etc.

You can still trap the key, just not assign it this way.

0
 
LVL 18

Expert Comment

by:Sethi
ID: 10750296
In the Form Load event write the following:
Me.KeyPreview = True

In Form Key Down:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
        if keycode= vbKeyF10 then
                msgbox "F10 is pressed"
        end if
    End Sub
0
 

Author Comment

by:aftab2003
ID: 10753420
Hi Sethi,

The code worked perfect. But at the same time it has activated "File" menu as mentioned by Bingie. Is there any way to avoid this ? like vbsendkey ?

Thanks for your help
0
 
LVL 18

Accepted Solution

by:
Sethi earned 55 total points
ID: 10753970
Yes. Write this line:
SendKeys "{Esc}"
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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

861 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

25 Experts available now in Live!

Get 1:1 Help Now