Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to skip & in the Menu string

2 views
Skip to first unread message

Matrixinline

unread,
Nov 20, 2009, 4:19:35 AM11/20/09
to
Hi All,

My Menu String is like " Application & Data"
I do InsertMenu. and when I see the menu it looks like "Application
_Data"

I guess & is the Skip character + it adds the next character as
Shortcut key of that menu Item.

But Can you please let me know how to Skip it? I tried \&, \\& but it
does not give any good result

Mikel

unread,
Nov 20, 2009, 4:45:29 AM11/20/09
to

Yes, "&" is used to add the shortcut. I think that you have to write
&& if you want to write "&"

David Lowndes

unread,
Nov 20, 2009, 4:46:12 AM11/20/09
to

Try &&

Dave

Tom Serface

unread,
Nov 20, 2009, 10:23:10 AM11/20/09
to

I see others have told you how to fix this problem and actually use the
ampersand in the text, but I just wanted to add that this is a very handy
paradigm and it works in menus, statics, checkboxes, and other controls
with text labels. So you should still have a accelerator key even if you
want to use the same character as part of the text like:

&Application && Data

Another trick we commonly use is to put three dots (ellipse) after the item
in a menu if it is going to pop up another screen or dialog. So, if in this
case you were going to pop up an Application & Data window you would put:

&Application && Data...

In the resource editor you can right click and pick "Check mnemonics" from
the menu to make sure there are no duplicate keys in your menu or dialog
items.

Tom

"Matrixinline" <anup.k...@gmail.com> wrote in message
news:e1bc73f5-5ff2-45c8...@e4g2000prn.googlegroups.com...

Mihai N.

unread,
Nov 23, 2009, 3:14:18 AM11/23/09
to

> In the resource editor you can right click and pick "Check mnemonics" from
> the menu to make sure there are no duplicate keys in your menu or dialog
> items.


There is no "Check mnemonics" for menus anymore (still there for dialogs).
This is part of the countless "enhancements" from VS6 to VS2002.


--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

David Lowndes

unread,
Nov 23, 2009, 7:06:56 AM11/23/09
to
>> In the resource editor you can right click and pick "Check mnemonics" from
>> the menu to make sure there are no duplicate keys in your menu or dialog
>> items.
>
>There is no "Check mnemonics" for menus anymore (still there for dialogs).

It's present in VS2010 (for the native menu editor).

Dave

Tom Serface

unread,
Nov 23, 2009, 11:07:07 AM11/23/09
to
It works for me in menus in 2008.

Tom

"Mihai N." <nmihai_y...@yahoo.com> wrote in message
news:Xns9CCC26D...@207.46.248.16...

Mihai N.

unread,
Nov 24, 2009, 3:52:39 AM11/24/09
to
> It's present in VS2010 (for the native menu editor).

Good to hear, I will take a look.
(I don't know if it is the result of my complaints,
but it was part of a longer list I have submitted :-)

Mihai N.

unread,
Nov 24, 2009, 3:56:55 AM11/24/09
to
> It works for me in menus in 2008.
Wow, you are right!
Where can I find it in the menus?
In order to use it I had to assign a hotkey to Edit.CheckMnemonics

Mikel

unread,
Nov 24, 2009, 4:19:40 AM11/24/09
to

I have it in VS2005 + SP1, too.
BTW, I didn't even know this option existed, but after readin this
thread I've looked for it and it is there, in the context menu of the
menu editor

Tom Serface

unread,
Nov 24, 2009, 11:43:43 AM11/24/09
to
I just open the menu then right click anywhere in the white space outside
the menu. It searches all the way down through the menus.

Whenever we have stuff translated I always have to go through this process
on each menu since some of the keys get messed up with the translations.
It's not an arduous process, but it gets tedious so I'm happy for tools like
this.

Tom

"Mihai N." <nmihai_y...@yahoo.com> wrote in message

news:Xns9CCD94B...@207.46.248.16...

Joseph M. Newcomer

unread,
Nov 24, 2009, 12:43:40 PM11/24/09
to
I did a similar tool for dialogs, for a similar reason. The problem with the "tool" that
was provided for dialogs was that it would just pop up a MessageBox and stop if there was
a duplicate shortcut, and it could not check for consistency across dialogs. So if in one
dialog I had &Name, and in another N&ame, and in a third Na&me, this would be really bad,
because each dialog would have a different shortcut. So I did something that produced an
actual *listing* of all the dialogs and all the shortcuts, and indicated conflicts. Much
more useful than the joke VS had for years. It's written in awk and it's on my Web site.
But it is hard to find good implementations of awk these days.
joe

Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Mihai N.

unread,
Nov 25, 2009, 1:39:06 AM11/25/09
to
> I just open the menu then right click anywhere in the white space outside
> the menu.

Hm, I haven't seen this before. In VS6 it used to be under tools.
The same menu option was also checking dialogs. And the accelerator was
Ctrl+M.

Now the dialog checker is under Format with Ctrl+M as accelerator,
and the menu checker is in the context meny, with no accelerator.
And I am pretty sure it was not there before SP1 (I have to check).


> It searches all the way down through the menus.

This is the old behavior.


> Whenever we have stuff translated I always have to go through this process
> on each menu since some of the keys get messed up with the translations.

Same here.

Mihai N.

unread,
Nov 25, 2009, 1:41:46 AM11/25/09
to

> So I did something that produced an
> actual *listing* of all the dialogs and all the shortcuts, and indicated
> conflicts.

Same here :-)
And with sugestions of rearanging the stuff to eliminate conflicts and
improve consistency.
Also taking a list of "fixed" quick-keys (that should not be moved because
they are standard (thing Copy or Paste) or because they used to be there in
a previous version (you don't want the quick keys to move around between
versions)

Joseph M. Newcomer

unread,
Nov 25, 2009, 12:22:25 PM11/25/09
to
YOU don't want them to change.
*I* don't want them to change.

Did you notice the shortcut keys always seem to change between releases of VS? SOMEBODY
likes to change them...
joe

On Tue, 24 Nov 2009 22:41:46 -0800, "Mihai N." <nmihai_y...@yahoo.com> wrote:

>
>> So I did something that produced an
>> actual *listing* of all the dialogs and all the shortcuts, and indicated
>> conflicts.
>
>Same here :-)
>And with sugestions of rearanging the stuff to eliminate conflicts and
>improve consistency.
>Also taking a list of "fixed" quick-keys (that should not be moved because
>they are standard (thing Copy or Paste) or because they used to be there in
>a previous version (you don't want the quick keys to move around between
>versions)

0 new messages