I am putting some custom controls, e.g. drop down buttons, custom menu items, none of them are inherited from any Tool button. When I press Alt to access their key tip, seems like they have been automatically assign.
Q1: how can i change the key tip content?
Q2: when i press a key tip for a custom drop down, it can be only be focused. How can i interfere with the behavior to make the drop down open?
Thanks, Nathan
I can manage to open the drop down and set my custom KeyTip, but still have 1 issue:
I have another custom control (like MenuItemEx) in my drop down, how can i set key tip onto those MenuItemEx?
I found an interface IKeyTip, but failed to add KeyTip to it.
Any ideas please?
Thanks,
Nathan
Hello Nathan,
Can you possibly send a small sample that can reproduce your problem?
Thank you,
Mihoko Kamiishi
Hello Nathan, Thank you for the code.
I'm currently looking into this.I will let you know when I have an update. Thank you, Mihoko Kamiishi
I have attached the sample that shows a keytip on a custom control implementing IKeyTip interface.
MenuItemEx here is the class implements MenuItem and IKeyTip.
Thanks a lot.
really appreciate that and it's a perfect answer for me.
But still got 1 question need to address out: how to deal with the multi-level menu items. I add another level of items to a sub menu item, and add some logic to get sub menu opened, but it cannot show anything key tip at all.
Code to active sub menu:
bool IKeyTip.Activate() { if (Items.Count > 0) { IsSubmenuOpen = true; return false; }
RaiseEvent(new RoutedEventArgs(MenuItem.ClickEvent)); return true; }
Any suggestions or examples please?
It seems that you need to return true in IKeyTip’s Activate() method in order to show a keytip on the sub menu items.
I have updated the sample to add another level of items to the custom menu.I modified some methods from IKeyTipContainer and IKeyTip there following the implementation of MenuToolBase.cs and ToolMenuItem.cs.
Thank you,Mihoko Kamiishi
hi, expert,
Thanks a lot. This is perfect!
That's exactly what I want. I really appreciate your efforts and it means a lot to me.
Best Regards,