That’s because of the akRight
in Panel.Anchors
and modern
WizardStyle
(or rather the 120 WizardSizePercent
it implies). The wizard is scaled only after the InitializeWizard
. With akRight
, the panel width will grow linearly (not proportionally) with the wizard. There are solutions, but they depend on how you actually want the panel to behave in the resizable wizard (also implied by the modern
style).
See also Inno Setup – how to center an animated gif in resized wizard.
If you want to keep the panel at half size, when the wizard is resized (either automatically due to WizardSizePercent
or by the user due to WizardResizable
), handle WizardForm.OnResize
:
[Code]
var
Page: TWizardPage;
Panel: TPanel;
procedure WizardFormResize(Sender: TObject);
begin
Panel.Width := Page.SurfaceWidth div 2;
end;
procedure InitializeWizard();
begin
Page := CreateCustomPage(
wpWelcome, 'Custom wizard page controls', 'TButton and others');
Panel := TPanel.Create(Page);
Panel.Width := Page.SurfaceWidth div 2;
// ...
WizardForm.OnResize := @WizardFormResize;
end;
Make sure you do not set the akRight
anchor.
CLICK HERE to find out more related problems solutions.