Stop ampersand from being turned into a mnemonic/accelerators for Windows Forms binding

binding, c#, winforms

Solution

You can prevent this by either doubling up on the ampersands (&& will display correctly as &), or you can set the UseMnemonic property of the label to false which is probably the best solution in your case

Problem

Possible Duplicate: Enter “&” symbol into a text Label in Windows Forms? On a screen with label controls bound to user-filled properties, I'm getting underlined characters (mnemonics) on the label because the underlying data contains ampersands. For example, if the bound property contains "A&B Trucking", then the label shows as "AB Trucking" with the B underlined. Alt-B on the keyboard would focus that label. How do you prevent this from happening with bound controls?

Original source

Related problems