问题
Here's a page from documentation: CreateInputQueryPage.
Why do we use &
character in the following part?
Page.Add('&Name:', False);
Page.Add('&Company:', False);
I tried omitting it but nothing changed.
回答1:
It determines, what letter serves as an access key for the control (for controls that have labels on their own, like checkboxes, radio buttons or buttons) or for the control associated with a label using the TLabel.FocusControl
property (for controls without their own labels, like edit boxes, combo boxes, list boxes, etc).
So in this case, if you press Alt+N, the focus moves to the "Name" box. While if you press Alt+C, the focus moves to the "Company" box.
Note that on the modern versions of Windows, the underline appears only once Windows determines, that you want to use the keyboard for navigating around the window. So for example after you press the Alt key.
If you want to change an access key of built-in Inno Setup controls, change their cation using the [Messages] section or in .isl
files.
[Messages]
ButtonBack=< Bac&k
A related question: How to add access key to button in Inno Setup
来源:https://stackoverflow.com/questions/64677060/why-do-we-use-character-in-inno-setup