Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to get ampersand (&) to display in a Delphi TActionMainMenuBar

I am in need of help trying to get the ampersand character to show up in a Delphi XE6 VCL TActionMainMenuBar. I have come across similar requests on Stack Overflow but none that directly address the problem I am having.

When creating an action in the TActionManager, I need the caption of an action to read Network & Database. I have tried using two ampersands in the caption Network && Database to escape the accelerator which did not work. When I included two ampersands, I ended up with Network _Database (See Screenshot1). I have also set the property of ActionBar > Items > AutoHotKeys to false and ActionMainMenuBar > PersistentHotKeys to false. Doing so did not rectify the my issue.

Screenshot1

The one thing I did try out of pure desperation that I thought fixed it was to include four ampersands Network &&&& Database which when ran showed up as Network & Database (See Screenshot2). However during testing, if I were to press Alt to turn on hotkeys and navigate into the menu, the caption of the action would read Network && Database. I tried to include a screenshot of this however since I have less than 10 reputation points Stack Overflow limits my post to two attachments.

Screenshot2

If anyone can point me in the right direction of if I have left out some information please let me know. I've run out of ideas on how to fix this and I cannot come across anything similar when searching Google. Thanks in advance for the help.

like image 210
CKilpatrick Avatar asked Feb 01 '17 22:02

CKilpatrick


People also ask

Why can't I get the at symbol on my keyboard?

This has happened because a recent Windows 10 update changed the default language and region settings to US English. To fix it, click the Windows button in the far left hand corner of your taskbar (or tap the Windows key on your keyboard) and start typing “Region & language settings”.

How do I get an ampersand on my UK keyboard?

Ampersand is part of number 7 key on most of the general English keyboard layout. You can use “Shift + 7” keys to type & symbol.


1 Answers

You can fix it on your form's onshow event

action3.caption := 'Network &&Database'; 
like image 172
Tony Hanna Avatar answered Oct 14 '22 18:10

Tony Hanna