Solved

F10 function key

Posted on 2004-04-03
4
1,327 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

762 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

26 Experts available now in Live!

Get 1:1 Help Now