Shortcut Key Not Underlined

G

Guest

I'm creating a main menu in C#. When I put an ampersand (&) ahead of a
character in a menuitem name, the following character is underlined, as
expected, in the design view.
When I run the app however, the behavior is not as expected: the underline
does not show until I hit the Alt key. Is this normal? Note that Visual
Studio itself does not behave this way. All of the underlines show whether
the Alt key is pressed or not.
Is there a form or menuitem property to control this behavior?
Thanks in advance for the help,
Dennis
 
T

Tim Wilson

Sounds like the system setting. Go to your "Display Properties", in the
Control Panel, and under the "Effects" tab you should see "Hide keyboard
navigation indicators until I use the Alt key". Uncheck this option. Note
that I am using a Windows 2000 Pro OS but I'd imagine that XP wouldn't be
too much different.
 
G

Guest

Hello Tim,
Thanks! You nailed it!
It took me awhile to find the setting in XP Pro, but when I unchecked it,
then my app worked as expected.
This begs the question however, as to how VS gets around this. As I
indicated in my original question, Visual Studio did display the underlines,
even when the Alt key was not pressed.
Maybe there is a programmatic way to override the system setting?
Thanks again,
Dennis
 
T

Tim Wilson

I believe that VS.Net uses a completely custom drawn menu. Whoever created
that menu probably overlooked this "feature" or didn't care to implement it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top