Hi, i am having an issue dropping down the File menu using the hotkey alt+f. I have successfully been able to drop it if alt is pressed and released followed by an ‘f’, opens the menu but pressing f with alt doesnt do the trick. This is the code that i am using.
< Menu Name="File_Menu" Background="LightGray">
< MenuItem Header="_File" Background="LightGray" Name="File_FileMenu" >
using the underscore at the begining of File enables the opening of the menu by first pressing and releasing 'alt' and then 'f'
i would want somehow the file menu to drop when both the keys are pressed together..
this is the code i have used earlier to assign hotkey
KeyGesture keyGestureAltF = new KeyGesture (Key.F, ModifierKeys.Alt); CommandBinding commandAltFBinding = new CommandBinding (CustomCommands.commandAltF, CommandBinding_FileMenu); CustomCommands.commandAltF.InputGestures.Add (keyGestureAltF); this.CommandBindings.Add (commandAltFBinding);
private void CommandBinding_FileMenu(object sender,ExecutedRoutedEventArgs e) { }
i would just want some code that is to be placed inside {} braces.