xiaoDD Posted May 6, 2003 Posted May 6, 2003 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 Quote
*Gurus* divil Posted May 6, 2003 *Gurus* Posted May 6, 2003 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
xiaoDD Posted May 6, 2003 Author Posted May 6, 2003 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 Quote
*Gurus* divil Posted May 6, 2003 *Gurus* Posted May 6, 2003 Because VB6 did not obey the operating system's rules as it should, and drew the underlines all the time. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
xiaoDD Posted May 6, 2003 Author Posted May 6, 2003 Hi divil, Thanks a lot for your explanation. I appreciate it very much. TQvM Quote
*Experts* Nerseus Posted May 7, 2003 *Experts* Posted May 7, 2003 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 Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.