3

I'm trying to build main menu with Delphi 10. When I'm setting menuitem ShortCut to "0" (main pad) - it works fine and looks like "Item 0". So, when I'm trying to set shortcut to "Num 0" - it works fine too, BUT, it looks like previous "Item 0". How can I "tell" user that he must press NumPad0 (and not main pad zero)?

  • It's deep inside the `TMenuItem.AppendTo` method, specifically the `ShortCutToText` function call which appends such shortcut text to the `Caption`. – Victoria Apr 23 '18 at 00:49

1 Answers1

4

As Victoria stated in comment on main question there's no practical way to accomplish this (you can of course signal this in quality portal at https://quality.embarcadero.com).

You can however draw menu items yourself setting TMainMenu.OwnerDraw to True and handling OnDrawItem or OnAdvancedDrawItem at TMenuItem level.

Depending on menu complexity this should not be too difficult and you can handle events only for items that have the problem (if you don't handle events for an item it should be drawn automatically).

If you prefer to create a new inherited component you should override AdvancedDrawItem method instead.

BigBother
  • 367
  • 2
  • 9