Inno Setup - 显示MsgBox并单击“确定”返回上一页

问题描述 投票:2回答:1

我有'A'页面TOutputMsgWizardPage和'B'页面TInputQueryWizardPage

当我点击B页的'下一步'时,显示一个包含'确定'和'取消'按钮的MsgBox。当我点击“确定”时,返回“A”页面。

会发生吗?

有关如何实现这一目标的任何提示?

页面序列是:WelcomePage => OutputMsgPage => InputQueryPage => SelectDirPage

inno-setup back-button pascalscript
1个回答
1
投票

使用TWizardPage.OnNextButtonClick处理“下一步”按钮点击。

处理“下一步”按钮时,您可以模拟按“返回”按钮返回上一页。

[Code]

var
  OutputMsgPage: TOutputMsgWizardPage;
  InputQueryPage: TInputQueryWizardPage;

function InputQueryPageNextButtonClick(Sender: TWizardPage): Boolean;
begin
  Result := True;

  if MsgBox('Go back?', mbConfirmation, MB_OKCANCEL) = IDOK then
  begin
    WizardForm.BackButton.OnClick(WizardForm.BackButton);

    Result := False;
  end;
end;

procedure InitializeWizard();
begin
  OutputMsgPage := CreateOutputMsgPage(wpWelcome, 'Output page', '', 'Output page');

  InputQueryPage := CreateInputQueryPage(OutputMsgPage.ID, 'Input page', '', 'Input page');
  InputQueryPage.OnNextButtonClick := @InputQueryPageNextButtonClick;
end;
© www.soinside.com 2019 - 2024. All rights reserved.