How to create new About button in Inno Setup?

≯℡__Kan透↙ 提交于 2019-12-04 21:10:28
TLama

Here is a simplified, inlined version of the minimum code necessary to do what you've asked for:

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