LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

menubar shortcut key

hi
i want to give shortcut key for toplevel menubar  item like FILE,EDIT etc...
also i want to catch the  callback function when i click the menubar ..
reply me the best to do this..
urs
sks
0 Kudos
Message 1 of 5
(3,689 Views)

For top level menu you can only use Alt+letter shortcut key defined using a double underscore before the letter to use as a shortcut (e.g. __File will result in File and the menu can be shown by pressing Alt+F keys).

As per menu callbacks I suggest you study this example that ships with CVI: \samples\userint\menus.prj.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(3,688 Views)
hi robert
your correct..but i didnt ask u that..
i asked you how to give shortcut key for top level menubar item..
such as consider File-OPEN,SAVE,EXIT.
                             Edit-CUT,COPY,PASTE.
i want to know how to give shortcut key for File and Edit..
 
0 Kudos
Message 3 of 5
(3,676 Views)
You cannot assign any other shortcut key to top level menu items than Alt+Letter, this is a constraint of Windows environment.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 5
(3,676 Views)
SKS,
 
If for some reason you do not want to use ALT-F for the file menu there is a round about way to implement the same feature.  You add a command button control that is configured to place ALT-F into the keyboard buffer using FakeKeystroke().  You set the hot key for this control to be the one you want for the file menu.  This control can be hidden behind something like a canvas or some other items on the panel.  Pressing the hot key now mimics the users pressing the ALT-F key and up pops the file menu. 
0 Kudos
Message 5 of 5
(3,670 Views)