Using Keyboard Shortcuts
Using Keyboard Shortcuts
Using Keyboard Shortcuts
Using Keyboard Shortcuts
Using Keyboard Shortcuts
Using Keyboard Shortcuts Using Keyboard Shortcuts Using Keyboard Shortcuts Using Keyboard Shortcuts Using Keyboard Shortcuts Using Keyboard Shortcuts Using Keyboard Shortcuts Using Keyboard Shortcuts
Using Keyboard Shortcuts Using Keyboard Shortcuts
Using Keyboard Shortcuts
Go Back  Xtreme Visual Basic Talk > > > Using Keyboard Shortcuts


Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-2010, 12:37 PM
SubTestEng SubTestEng is offline
Newcomer
 
Join Date: Mar 2010
Posts: 19
Default Using Keyboard Shortcuts


Hello, friends!

I am hoping someone can help. I have just today learned that in order for the underline to appear under a letter on a button signifying the ability to use that letter as a shortcut, Windows must have a certain setting.

For example if I have a button that says "Copy" and I want the "C" underlined so I can press the "c" key and have the buttonpressed event fire, I have to have "Hide Underlined letters for keyboard navigation until I press the ALT key" unchecked in the Display Properties>Appearance>Effects area. If it is checked, a user would have to press the ALT key to make the underline visible (for each form).

Since the default setting for Windows (XP at least) is that the "Hide Underlined..." is checked, and since my deployment may be on several standalone computers, I am looking for a way to programmatically uncheck the option.

I am using VS 2010 Pro on a dell laptop running Win XP-64 bit.

Thanks in advance for any advice!

Cheers!

David
Reply With Quote
  #2  
Old 09-15-2010, 12:55 PM
AtmaWeapon's Avatar
AtmaWeaponUsing Keyboard Shortcuts AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Don't do this.

It's a system-wide setting that the user may have intentionally set the way it is. I know it's the default, but they may run your application and notice that every application suddenly displays underlines and they may not want this. There's no way to set it for just your application. You should never alter system-wide settings like this. If you think that for some reason your application is special and absolutely needs to vary from the behavior that there is a 99.9% probability the users are used to already, you should provide documentation that directs the user through the process of changing the setting themselves.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #3  
Old 09-15-2010, 01:55 PM
SubTestEng SubTestEng is offline
Newcomer
 
Join Date: Mar 2010
Posts: 19
Default

AtmaWeapon,

Thanks very much for the quick response and the advice. I will follow your advice. I am not certain why having a default setting that tells the user that shortcuts are available would be a bad thing, but there must be some reason Microsoft made it this way.

Thanks very much!

Cheers!

David
Reply With Quote
  #4  
Old 09-15-2010, 05:12 PM
AtmaWeapon's Avatar
AtmaWeaponUsing Keyboard Shortcuts AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Microsoft made this change in XP. The explanation is they did years of usability research and found that having the underlined characters affects readability; people's eyes are drawn to the underlines and it takes slightly longer to read and recognize text when the underlines are there. I haven't seen data to support it, but I saw them say this in several different places.

I agree with you; in my opinion these shortcuts (called "keyboard accelerators") are always part of menu items, labels, buttons, and other elements that shouldn't have large amounts of text. My intuition tells me that having to wait to push the Alt key to see the underlines would negate any milliseconds saved by the readability loss, but MS felt differently. I turn the setting off on my computers.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #5  
Old 09-16-2010, 09:20 AM
SubTestEng SubTestEng is offline
Newcomer
 
Join Date: Mar 2010
Posts: 19
Default

AtmaWeapon,

Do you think running some kind of subroutine that is called during the form load event that effectively "presses" the Alt key would be a good idea? Do you know of an easy way to implement it?

Thanks!

Cheers!

David
Reply With Quote
  #6  
Old 09-16-2010, 09:27 AM
PlausiblyDamp's Avatar
PlausiblyDampUsing Keyboard Shortcuts PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

I would imagine that the faked "alt" keystroke would then mean the subsequent key press would be treated as a follow on to the "alt".

This is probably more likely to confuse the users than actually help them.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #7  
Old 09-16-2010, 10:08 AM
AtmaWeapon's Avatar
AtmaWeaponUsing Keyboard Shortcuts AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Why is it so important to you that the underlines be displayed? If the user has used a computer and is familiar with keyboard accelerators they are already used to having to push Alt to see them, and to be honest they should learn pretty quickly what accelerators map to things.

If you want to really help your users, set up real shortcuts like "CTRL+M" or "F6" for common menu items. I generally prefer to use those rather than dig about in the menu.

Incidentally, I just noticed that whatever lame-o graphical toolkit Firefox is using doesn't respect my system's settings and displays the underlines no matter what. Yet another inconsistency with the Windows environment for Firefox, and yet another reason to give Chrome another try
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #8  
Old 09-21-2010, 09:30 AM
SubTestEng SubTestEng is offline
Newcomer
 
Join Date: Mar 2010
Posts: 19
Default

Well, I have decided not to try to force it one way or the other. The software we create is strictly for in-house use. The only reason that I was interested in having the accelerators was for some of our old-timers who used the previous editions keyboard controls (on 486s with no mouse!).

Thanks for all your input!

Cheers!
Reply With Quote
  #9  
Old 09-21-2010, 10:43 AM
AtmaWeapon's Avatar
AtmaWeaponUsing Keyboard Shortcuts AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Whether the underlines are visible or not has no bearing on whether the accelerators work. The underline is just a visual clue as to the accelerator. If the users push the "Alt" key, they'll see the underlines and they will work. Alternatively, you can instruct the users how to change the system setting/change it for them.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Using Keyboard Shortcuts
Using Keyboard Shortcuts
Using Keyboard Shortcuts Using Keyboard Shortcuts
Using Keyboard Shortcuts
Using Keyboard Shortcuts
Using Keyboard Shortcuts Using Keyboard Shortcuts Using Keyboard Shortcuts Using Keyboard Shortcuts Using Keyboard Shortcuts Using Keyboard Shortcuts Using Keyboard Shortcuts
Using Keyboard Shortcuts
Using Keyboard Shortcuts
 
Using Keyboard Shortcuts
Using Keyboard Shortcuts
 
-->