Microsoft KB Archive/67716

{|
 * width="100%"|

HOWTO: Assign Mnemonics to Owner-Draw Push Buttons

 * }

Q67716

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)
 * Microsoft Windows Software Development Kit (SDK) versions 3.0, 3.1

-

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 &quot;&X&quot; 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.

Additional query words:

Keywords : kbButton kbCtrl kbOSWinNT kbOSWin2000 kbSDKWin32 kbGrpDSUser kbOSWin

Issue type : kbhowto

Technology : kbWin32SDKSearch kbAudDeveloper kbWin3xSearch kbSDKSearch kbWin32sSearch kbWinSDKSearch kbWinSDK300 kbWinSDK310