Page 1 of 1

Alt Key Accelerator Not Working

Posted: Wed Apr 17, 2024 12:53 pm
by mbond
Hello,

My requirement is for all buttons to have an Alt key accelerator. To be clear, this is when the caption of the button shows an underlined character. Pressing Alt + <the underlined character> will activate the button the same as a left mouse click would. Do do this, just add an ampersand "&" immediately before the character you want to underline in the Caption property of the control. I have this work everywhere except one button.

I have a custom dialog with the standard Back, Next, and Cancel buttons with captions of "< &Back", "&Next >" and "&Cancel". The Next and Cancel buttons are working fine with the accelerators. However, the Back button won't trigger with Alt-B. I can see the problem both when testing the dialog and when running the full compiled installer. If I use the mouse to click the button, then it works fine. Additionally, on every other dialog that has the same 3 buttons the Back button works just fine. I've included screen shots of the Back and Next button properties.

So what is wrong with this one Back button, and how do I fix it?

Thanks in advance,
Bond

Re: Alt Key Accelerator Not Working

Posted: Fri Apr 19, 2024 11:50 am
by JohnGaver
This topic applies to InstallAware Multi Platform as well.

An accelerator cannot be shared by more than one component.

If an accelerator is used in the caption field of a label, that label will select the control referred to in its FocusControl property.

Your:

Code: Select all

Data&base Name


label appears to be one such control.