【问题标题】:How to create new About button in Inno Setup?如何在 Inno Setup 中创建新的 About 按钮?
【发布时间】:2015-06-16 12:19:56
【问题描述】:

我想在所有页面的左下角创建一个新的关于按钮,例如wpWelcomewpSelectTaskswpInstalling 等; 如果单击它会显示一些消息。如果用户按下“确定”,消息应该关闭。该按钮应显示完整的单词“About”,而不是“Abou ...” 我在 Inno Setup 中检查了CodeClasses.iss 文件,但我不明白我应该复制哪一段代码,哪一段不应该。

这两个帖子我已经看过了:

但它们并不是我真正想要的。

所以请大家帮忙。

【问题讨论】:

    标签: inno-setup pascalscript


    【解决方案1】:

    这是完成您要求的最少代码的简化内联版本:

    [Setup]
    AppName=My Program
    AppVersion=1.5
    DefaultDirName={pf}\My Program
    
    [Code]
    procedure AboutButtonOnClick(Sender: TObject);
    begin
      MsgBox('This is the about message!', mbInformation, mb_Ok);
    end;
    
    procedure InitializeWizard;
    var
      AboutButton: TNewButton;
    begin
      { create an instance of the button and assign it to the local variable AboutButton }
      AboutButton := TNewButton.Create(WizardForm);
      { set the parent to the just created button control }
      AboutButton.Parent := WizardForm;
      { adjust the position to the created button control; it gets the horizontal indent }
      { by the right indent of the Cancel button; the vertical position as well as width }
      { and height are the same as the Cancel button has }
      AboutButton.Left := WizardForm.ClientWidth - WizardForm.CancelButton.Left -
        WizardForm.CancelButton.Width;
      AboutButton.Top := WizardForm.CancelButton.Top;
      AboutButton.Width := WizardForm.CancelButton.Width;
      AboutButton.Height := WizardForm.CancelButton.Height;
      { set its caption }
      AboutButton.Caption := '&About';
      { and assign the AboutButtonOnClick method to the OnClick event of the button }
      AboutButton.OnClick := @AboutButtonOnClick;
    end;
    

    【讨论】:

    • P.S.该按钮标题是About...,而不仅仅是Abou...。所以它是完整的,甚至更多:) 这只是我对省略号的热情......
    • 哇!这正是我想要的。谢谢。
    猜你喜欢
    • 1970-01-01
    • 2016-01-07
    • 1970-01-01
    • 1970-01-01
    • 2015-12-21
    • 2013-09-05
    • 1970-01-01
    • 1970-01-01
    • 2016-03-04
    相关资源
    最近更新 更多