本文介绍了如何在Inno Setup中向按钮添加访问密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在音频按钮中添加 Alt 功能;静音的和 Play 的像这样
I want to add Alt functions to my audio button; for Mute and for PlayLike 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中向按钮添加访问密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!