Link to home
Start Free TrialLog in
Avatar of ackid32
ackid32

asked on

How to Change Menu Short-cut Key at Run-time?

How to Change Menu Short-cut Key at Run-time?
Avatar of barendb
barendb

If you are talking about the Alt-<key> shortcut, just change your caption.  Other shortcut keys I'm not sure about the others.
Avatar of ackid32

ASKER

i want to use shift-f9 (like) for a menu item at run time
how?
I think that you would have to Dim the keys as integers or somethin and then tell the computer when such and such a keypress action is taken to perform the action u need.
Hello,

Set KeyPreview property of the form to True and add KeyDown or KeyUp routines for your form like:


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If Shift = vbShiftMask And KeyCode = vbKeyF9 Then
  '  add MenuProcessing here
End If

End Sub

Or, if you have special options form you can get appropriate key code (intMyCode) and shift mask (intMyShift) there and then the code will look like:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If Shift = intMyShift And KeyCode = intMyCode Then
  '  add MenuProcessing here
End If

End Sub

Hope this will help.

Sincerely,
Crin

Avatar of ackid32

ASKER

It is impossible. Because i have menu in my MDI form Only. I can't write in Keydown event of every form in my Project.
Why not?
Just add simple three lines of code for each form (except MDI form):

private sub Form_KeyDown(KeyCode as integer, Shift as integer)
  frmMDIForm.Form_KeyDown(KeyCode, Shift)
end sub

That's all :)

Sincerely,
Crin

PS. The only way I can suggest otherwise - to create system-wide shortcuts. But they worth more for sure :)
Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  https://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.

To view your open questions, please click the following link(s) and keep them all current with updates.
https://www.experts-exchange.com/questions/Q.20159520.html
https://www.experts-exchange.com/questions/Q.20250995.html
https://www.experts-exchange.com/questions/Q.20265829.html




PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
Avatar of DanRollins
Hi ackid32,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.

ackid32, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
Avatar of Netminder
Netminder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial