Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2006

Tip: Looking for answers? Try searching our database.

Accelerator keys broken in Winforms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
km - 07 Jul 2006 20:41 GMT
I'm having a problem with accelerator keys (also sometimes refered to as
shortcut keys or mnemonics) on Winforms. To reproduce, simply do this:
1. create a new C# "Windows Application" project (I'm using VS2005)
2. Add a button to the form and change its default Text from "button1" to
"&button1"

Now run the app. Press the alt key on the keyboard and the keyboard cue is
displayed (the 'b' becomes underlined) as it should. Press the alt key again
and the
underline does not go away. You will also notice that pressing the 'b' key
fires the button's click event regardless of whether the alt key was ever
pressed, or whether the cue is visible.

Surely this isn't "by design" (Menus don't work this way! OS supplied
dialogs don't work this way!)

Any pertinent suggestions on how to work around this would be welcome. TIA
Herfried K. Wagner [MVP] - 07 Jul 2006 22:06 GMT
"km" <km@discussions.microsoft.com> schrieb:
> I'm having a problem with accelerator keys (also sometimes refered to as
> shortcut keys or mnemonics) on Winforms. To reproduce, simply do this:
[quoted text clipped - 12 lines]
> Surely this isn't "by design" (Menus don't work this way! OS supplied
> dialogs don't work this way!)

This behavior is by design and can be found in all Windows application which
use Windows' controls.

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.