如何在Inno Setup TInputQueryWizardPage(CreateInputQueryPage)上减小两个输入框之间的行距

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

我有一个带有8个用户输入的TInputQueryWizardPage页面。 wizard page has been increased但所有值仍然不可见。有没有一种方法可以减小两个值之间的行距,以便所有值都以当前向导的大小显示?

enter image description here

installer inno-setup pascalscript
1个回答
1
投票

使用TInputQueryWizardPage.EditsTInputQueryWizardPage.PromptLabels访问控件并根据需要重新放置它们:

[Code]

procedure ReducePromptSpacing(Page: TInputQueryWizardPage; Count: Integer; Delta: Integer);
var
  I: Integer;
begin
  for I := 1 to Count - 1 do
  begin
    Page.Edits[I].Top := Page.Edits[I].Top - Delta * I;
    Page.PromptLabels[I].Top := Page.PromptLabels[I].Top - Delta * I;
  end;
end;

procedure InitializeWizard();
var
  Page: TInputQueryWizardPage;
begin
  Page := CreateInputQueryPage(wpWelcome,
    'Personal Information', 'Who are you?',
    'Please specify your name and the company for whom you work, then click Next.');

  Page.Add('Prompt 1:', False);
  Page.Add('Prompt 2:', False);
  Page.Add('Prompt 3:', False);
  Page.Add('Prompt 4:', False);
  Page.Add('Prompt 5:', False);

  ReducePromptSpacing(Page, 5, ScaleY(10));
end;

标准布局:

enter image description here

间距减少10像素的布局:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.