Hi,
I have a Windows Forms application which is using the infragistics toolbar control.
In this form there a context menu having a menu item with shortcut key as F10, this shortcut is not working. When this key is pressed the Ribbon control is activated and showing the accelator keys of each ribbon tab. How can I solve this issue without changing the shortcut key.
Regards,
Ceaser
Did you check to see if there is perhaps some other control with the same key mapping in the application?
According to the Office 2007 UI Guidelines, lines 944, 946, and 949, when the F10 key is pressed and released, it must give focus to the Ribbon and show the keytips. So you should really be using a different shortcut for the context menu if the Ribbon is shown. The F10 key is handled by a message filter on the UltraToolbarsManager, so any key handling code you are using to trap for F10 will not get hit.
Mike -
Is there any way for us to hook into the message filter on the UltraToolbarsManager? I'm using vb.net and have been able to create a work around using the System.Windows.Forms.IMessageFilter interface, however, the PreMessageFilter does not completely pre-filter the messages going to the toolbar control. Simply changing the shortcut key is not an option for us.
For those of you who want a work around:
Public Function PreFilterMessage(ByRef m As Message) As Boolean Implements Windows.Forms.IMessageFilter.PreFilterMessage Try Select Case m.WParam Case 121 'F10 Key... WParam is mapped the same as vbscript window.event.keycodes....
HandleShortCut()
Return True
Case Else Return False End Select Catch ex As Exception End Try End Function
Awesome - you are right. I implemented the MessageFilter in the vb.net Module that launches our form application. Turns out, if you add the MessageFilter to a form that has an UltraToolbarsManager on it, the UltraToolbarsManager message filter is added first. Thanks for the help!
- Mike B
I guess you could try to add your message filter before the UltraToolbarsManager is created and has a chance to add it's message filter. I'm not 100% certain on whether or not the order of filters is honored when they are processing messages, but if they are, your's should get first crack at it.