InnoSetup-カスタムボタンをキャンセルボタンに合わせる

Aug 19 2020

このセクションで使用しているときに、[キャンセル]ボタンと同じトップサイズにボタンを設定すると問題が発生します。WizardSizePercent = 150Setup

これが私のコードです:

AboutButton := TNewButton.Create(WizardForm);
AboutButton.Parent := WizardForm;
AboutButton.Left := WizardForm.CancelButton.Left;
AboutButton.Top := WizardForm.CancelButton.Top;
AboutButton.Width := WizardForm.CancelButton.Width;
AboutButton.Height := WizardForm.CancelButton.Height;

Inno SetupはWizardSizePercent通常のWizardFormサイズしか使用しないため、に気付かないと思います。

回答

1 MartinPrikryl Aug 19 2020 at 14:14

あなたのコードはにあると思いますInitializeWizard。そのイベント関数WizardSizePercentは、適用される前に発生します。WizardSizePercentまたはのいずれかが原因でウィザードウィンドウのサイズが変更されたときにボタンを正しく配置する場合は、WizardResizable次のドキュメントに従う必要があります。

使用AnchorsおよびKeepSizeYプロパティのフルサポートを追加するWizardResizableWizardSizePercent、すべてのカスタムコントロール、カスタムウィザードページとにTSetupForm何かを持っている場合はフォームを。例については、CodeClasses.issサンプルスクリプトを参照してください。

だから特に:

AboutButton.Anchors := WizardForm.CancelButton.Anchors;

CancelButton.Anchorsです[akRight, akBottom]。あなたの場合は、「約」ボタンが左揃えする必要があり、使用:

AboutButton.Anchors := [akLeft, akBottom];