First as a prologue, I am aware of the deficiency that radmenus do not show the accelerator key all the time, despite the windows default having been set. To get around that, I have added code which I have found elsewhere in this forum, basically this:
I am pointing this out because it may be relevant to current issue.
Ok let's say you have this in place:
- You have parent window, with a menu, where one of the items has an accelerator key of "a".
- You have a child window, with a control, with an accelerator key of "a"
So two controls with the same accelerator key. Here is what you do with normal windows forms to invoke one or the other
- If you HOLD DOWN the Alt key, and press your accelerator letter at the same time, this invokes the control on the child window.
- If you press and RELEASE the Alt key, the focus is now on the menu, and you can then type "a" to invoke the menu item.
But here is what happens if the menu is a radmenu:
- I press and HOLD DOWN the Alt key, and then press "a" at the same time. Result? Focus goes to the menu. It should not, it should set focus to the control on the child form.
Thanks for looking.
Public Sub ShowMenuShortCuts(ByVal AMenuItems As Telerik.WinControls.RadItemOwnerCollection) Dim i As Int32 = 0 While (i < AMenuItems.Count) Try CType(AMenuItems(i).Children(2).Children(0).Children(1).Children(0), Telerik.WinControls.Primitives.TextPrimitive).ShowKeyboardCues = True AddHandler CType(AMenuItems(i).Children(2).Children(0).Children(1).Children(0), Telerik.WinControls.Primitives.TextPrimitive).PropertyChanged, AddressOf MenuPropertyChanged If (TypeOf AMenuItems(i) Is myMenuItem) AndAlso (CType(AMenuItems(i), myMenuItem).Items.Count > 0) Then ShowMenuShortCuts(CType(AMenuItems(i), myMenuItem).Items) End If Catch 'Failure End Try i += 1 End WhileEnd SubPublic Sub MenuPropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) Dim tPrimitive As Telerik.WinControls.Primitives.TextPrimitive tPrimitive = CType(sender, Telerik.WinControls.Primitives.TextPrimitive) If (e.PropertyName = "ShowKeyboardCues" AndAlso (Not tPrimitive.ShowKeyboardCues)) Then tPrimitive.ShowKeyboardCues = True End IfEnd SubI am pointing this out because it may be relevant to current issue.
Ok let's say you have this in place:
- You have parent window, with a menu, where one of the items has an accelerator key of "a".
- You have a child window, with a control, with an accelerator key of "a"
So two controls with the same accelerator key. Here is what you do with normal windows forms to invoke one or the other
- If you HOLD DOWN the Alt key, and press your accelerator letter at the same time, this invokes the control on the child window.
- If you press and RELEASE the Alt key, the focus is now on the menu, and you can then type "a" to invoke the menu item.
But here is what happens if the menu is a radmenu:
- I press and HOLD DOWN the Alt key, and then press "a" at the same time. Result? Focus goes to the menu. It should not, it should set focus to the control on the child form.
Thanks for looking.
