1
votes

I am try to use Owner-Draw menu. The only problem I can not solve is that I don't know how to implement (or enable?) the Menu Accelerator Keys (underline). I am using Win32, and what I am concerning is the main menu, not the submenu. How can I implement or enable underlines when I use Owner-Draw menu?

p.s. The Menu Accelerator Keys is a letter with a underline, which is used when users press Alt to access menu items. It is created by & character such as Save &As.

2

2 Answers

5
votes

Use DrawTextEx() to draw the text, it takes care of it automatically. Use the DT_HIDEPREFIX option if you need to hide the underline, DT_NOPREFIX if you need to display the & for some reason.

0
votes

The & before a char to underline it works also for DrawText(); the DT_HIDEPREFIX works as well. At least this works fine for an owner-draw button control.