HOWTO: Assign Mnemonics to Owner-Draw Push Buttons

ID: Q67716


The information in this article applies to:


SUMMARY

An application that uses owner-draw push buttons is always responsible for the appearance of the buttons. It might seem that in doing so, the ability to assign a mnemonic character to an owner-draw button is lost because text containing the mnemonic may not be displayed.

Fortunately, this is not the case. If an owner-draw button should be activated by ALT+X, place "&X" into the button text. NOTE: You have to use DrawText() to get the & character to underline the next character. Using TextOut() will not cause the & character to underline the next character in the string.

When the ALT key is pressed in combination with any character, Windows examines the text of each control to determine which control, if any, uses that particular mnemonic. With an owner-draw button, the text exists, but may not necessarily be used to paint the button.


Keywords          : kbButton kbCtrl kbNTOS kbGrpUser kbWinOS 
Version           : 
Platform          : 
Issue type        : kbhowto 

Last Reviewed: March 6, 1999