How to insert that ampersand into a label (WinForms)

This was a rough morning, all right! Especially since it was so difficult to insert an ampersand (&) in that freakin’ label!

So the problem is that & is used for the mnemonic function (you know… in case you want the File menu to pop up when you press the ‘F’ key on your keyboard, you would name the File menu as ‘&File’).

untitled4

Therefore, having a label text called ‘a&b’ would require:

1. disable the menmonic function: UseMnemonic = False

2. change the label’s text to a&&b

untitled5

I admit it’s kind of lame to have a post about this, but you just might wonder one day why your label isn’t listening 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: