Solved

F10 function key

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 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