Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Gurus*
Posted
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.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

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

  • *Experts*
Posted

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

"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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...