How to reduce the line spacing between two input boxes on Inno Setup TInputQueryWizardPage (CreateInputQueryPage)

蹲街弑〆低调 提交于 2020-01-13 20:25:15

问题


I have a TInputQueryWizardPage page with 8 user inputs. The wizard page has been increased but still all the values are not visible. Is there a way to reduce the line spacing between two values so that all the values will be displayed with the current wizard size?


回答1:


Use TInputQueryWizardPage.Edits and TInputQueryWizardPage.PromptLabels to access the controls and re-locate them as you need:

[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;

Standard layout:

Layout with the spacing reduced by 10 pixels:



来源:https://stackoverflow.com/questions/59625432/how-to-reduce-the-line-spacing-between-two-input-boxes-on-inno-setup-tinputquery

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