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
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,
Nathan
Hello Nathan,
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
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?
Thanks,
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.
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