C# Hotkeys

  • Thread starter Thread starter Jason Duncan
  • Start date Start date
J

Jason Duncan

I have a C# WinForm application (.net 1.0). On my Menu
and Buttons I use the '&' (in the .Text properties) for
Hotkey access. No biggie. The strange behavior is that
the '&' is converted to the appropriate underscore while
in design mode BUT DOES NOT appear at Runtime.

At runtime the Hotkey functionality works, but the
relevant underscores do not appear. For example, I have a
buttonStart.Text = "&Start". At Runtime, the button
displays as "Start" and pressing "S" triggers the event.

Is this a bug? Or is there an obvious solution I have
overlooked. I do have KeyPreview = true.

Any suggestions would be greatly appreciated!
Thanks,
Jason
 
It depends on your System Accessibility settings. Sometimes hot keys are
not displayed until you press "Alt" key. You can change the behavior in
Display Settings->Appearance->Effects (on XP)

-vJ
 
Thanks VJ.

You are correct, and this fixed the problem.

Right-Click Desktop...
Properties->Display settings->Appearance->Effects (on XP)
Uncheck the "Hide keyboard navigation indicators until I
use the Alt key" box.

Underscores now appear for the appropriate Hotkeys.

Jason
 
Back
Top