Attention: We are retiring the ASP.NET Community Blogs. Learn more >

UseMnemonic

This one kicked me in the butt for a few minutes this morning.  We have a custom address label which was making ampersands in names access keys.

Per the sdk:

"Note   You may want to display ampersands in a label control, rather than use them to create access keys. This may occur if you bind a label control to a field in a recordset where the data includes ampersands. To display ampersands in a label control, set the UseMnemonic property to false. If you wish to display ampersands and also have an access key, set the UseMnemonic property to true and indicate the access key with one ampersand (&) and the ampersand to display with two ampersands."

 

2 Comments

  • Greg- FYI: as per Duncan Mackenzie:

    "This is a standard UI convention in Visual Basic (and other Microsoft

    development tools I believe), the & character is used to indicate that

    the next character is the hotkey for that control (and should be

    underlined if that setting is turned on), so if you want to show an

    actual & you have to 'escape' it by doubling it up."



  • Yup, that's been there since VB6 (and probably before)...gotta watch out for that ;) That one should be in an FAQ somewhere :|

Comments have been disabled for this content.