Solved

F10 function key

Posted on 2004-04-03
4
1,336 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 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…

726 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