【问题标题】:Inno Setup button caption with line breaks带有换行符的 Inno Setup 按钮标题
【发布时间】:2016-12-29 16:26:19
【问题描述】:

我正在尝试创建一个包含换行符的按钮标题:

Button.Caption := 'Line1' + #13#10 + 'Line2';

但是,标准换行符 #13#10 在这种情况下似乎不起作用:

Line1Line2

显示在按钮上。将按钮标题分成多行的正确语法是什么?

【问题讨论】:

    标签: inno-setup pascalscript


    【解决方案1】:

    基于Newline character in caption of button(在 Delphi 中):

    function GetWindowLong(Wnd: HWnd; Index: Integer): LongInt;
      external 'GetWindowLongW@user32.dll stdcall';
    function SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: LongInt): LongInt;
      external 'SetWindowLongW@user32.dll stdcall';
    
    const
      GWL_STYLE = -16;
      BS_MULTILINE = $2000;
    
    procedure InitializeWizard();
    var
      Button: TNewButton;
    begin
      Button := TNewButton.Create(WizardForm);
      Button.Left := ScaleX(16);
      Button.Top := WizardForm.NextButton.Top - ScaleX(8);
      Button.Width := WizardForm.NextButton.Width;
      Button.Height := WizardForm.NextButton.Height + ScaleY(16);
      Button.Parent := WizardForm;
    
      SetWindowLong(Button.Handle, GWL_STYLE, 
        GetWindowLong(Button.Handle, GWL_STYLE) or BS_MULTILINE);
    
      Button.Caption := 'foo' + #13#10 + 'bar';
    end;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多