如何在Inno Setup中向按钮添加访问密钥 [英] How to add access key to button in Inno Setup

查看:142
本文介绍了如何在Inno Setup中向按钮添加访问密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在音频按钮中添加 Alt 功能; 静音 Alt + M Play Alt + P 像这样

I want to add Alt functions to my audio button; Alt+M for Mute and Alt+P for Play Like this

如何?应该输入什么代码?我将在哪里插入代码?这是我的脚本:

How? What code should be entered? Where will I insert the code? Here's my script:

SoundCtrlButton := TNewButton.Create(WizardForm);
SoundCtrlButton.Parent := WizardForm;
SoundCtrlButton.Left := 8;
SoundCtrlButton.Top := WizardForm.ClientHeight - 
  SoundCtrlButton.Height - 8;
SoundCtrlButton.Width := 40;
SoundCtrlButton.Caption :=
  ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}');
SoundCtrlButton.OnClick := @SoundCtrlButtonClick;

推荐答案

在Windows控件中,只需在控件标题中的字母前加上&即可将其标记为访问键.

In Windows controls, you just prefix a letter in control caption with & to mark is as an access key.

请参见 https: //docs.microsoft.com/zh-CN/cpp/windows/defining-mnemonics-access-keys#mnemonics-access-keys

SoundCtrlButton.Caption := '&Mute';

或者在您的情况下,通过自定义消息间接进行:

Or in your case, indirectly via a custom message:

[CustomMessages]
SoundCtrlButtonCaptionSoundOff=&Mute

查看在Default.isl中如何定义标准按钮标题:

See how the standard button captions are defined in Default.isl:

ButtonBack=< &Back
ButtonNext=&Next >
ButtonInstall=&Install

这篇关于如何在Inno Setup中向按钮添加访问密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆