Why ALT key does not function well in program written using VS .NET?

xiaoDD

Newcomer
Joined
May 6, 2003
Messages
8
I wrote a simple program using Visual Basic from Visual Studio .NET. The simple program had three buttons, i.e. Display, Clear and Exit. As you can see, different access keys had been assigned to the buttons, i.e. ALT+D for Display button, ALT+C for Clear button, and ALT+X for Exit button. No any further code was attached to the objects. Once the 'visual' programming part of the job was completed, I executed the program by selecting 'Start' (or by pressing F5). I found that NO UNDERLINED character appeared on each button in the executed program. In other words, for example, Display instead of Display was shown on 'Display' button. However, when I press 'ALT' key (only ONE key) on the keyboard, the UNDERLINED characters were appeared. Would anyone please advise why does the ALT key in program written using Visual Studion .NET act weird/differently?

TQvM
 
This is the proper behaviour for all programs running on Windows 2000 or later. Keyboard accelerators are not displayed until the user hits the Alt key. I believe you can set them to be displayed all the time somewhere in the display settings.
 
Hi,

Thanks for your comment.

For your information, I'm using Windows XP Professional and have both Visual Studio 6.0 and Visual Studio .NET installed in my PC. I wrote the program in VS .NET and VS 6.0 as well. I found that ALT key of the program written using VS 6.0 worked fine (in Windows XP). But ALT key of the program written using VS .NET worked differently.

If you say that 'This is the proper behaviour for all programs running on Windows 2000 or later. Keyboard accelerators are not displayed until the user hits the Alt key', why did the ALT key of the program written using VS 6.0 work immediately without requiring the user to hit the ALT key?

Please advise.

TQvM
 
Because VB6 did not obey the operating system's rules as it should, and drew the underlines all the time.
 
You'll notice a number of MS programs follow the same non-standard menus. For instance, Visual Studio itself always shows the underlines (on my machine anyway), as does Outlook, Outlook Express, and Word. Most other programs, including IE, do not show the underlines until Alt is held (assuming you have this option turned on, which is the OS's default).

I hear this questions ALL the time from my QA team. They never believe since so many of MS products ALWAYS show the underline...

-Nerseus
 
Back
Top