In .Net Windows Application Short Keys are not enabled automatically.
Usually the underline appears only after you press the ALT Key, but you can enable it by changing the Operating System Settings. On Windows XP, Right Click Desktop to bring up the Display Properties Dialog and then choose Appearance tab and then the Effects Button and uncheck the checkbox "Hide Underlined letters for keyboard navigation until I press the ALT Key".
But how to do it programmatically? The below code demonstrate how to do that!!!
Using the code
Generally in Windows Projects, we will have General.cs Class which contains general functions, Constants, Delegates, and Global variables which are used by other classes of Application.
Paste code in General.cs
static extern void SystemParametersInfo(uint uiAction, uint uiParam, ref int pvParam,
const uint SPI_SETKEYBOARDCUES = 0x100B;
private static void GetAltKeyFixed()
int pv = 1;
SystemParametersInfo(SPI_SETKEYBOARDCUES, 0, ref pv, 0);
assembly in General.cs
GetAltKeyFixed in Program.cs before
Or copy below code before
General _General=new general();
Points of Interest
This issue is seems to be there for all .net windows applications.
Adding Two lines of code, will fix Displaying Underline Issue for Shortcut keys of application