Why do we use '&' character in Inno Setup?

让人想犯罪 __ 提交于 2021-02-07 10:47:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!