2012-07-30 16 views
10

インストーラのインストール手順で、下のイメージのような内容を表示したい...私は内容を表示するためにメモを使用しましたが、メモは適切なコントロールではありません。ユーザープットがメモフィールドに焦点を当てた場合、それはテキストボックスのように見えます...ユーザーは、このステップに来るとき、最初にメモフィールドを選択します。..画像の下に表示さ... installation typeinnoセットアップインストーラで複数行の内容を表示するコントロール

+3

'TLabel'または' TNewStaticText'を使って 'WordWrap'をTrueに、' AutoSize'をFalseに設定します。 – TLama

答えて

8

使用TLabelまたはTNewStaticTextいずれかの成分(

  • TNewStaticTextは、以下のInnoSetupの内側に好適)と、それを設定しているようですFalse

にプロパティTrue

  • からAutoSizeプロパティそれからちょうどあなたの所望の位置にコンポーネントを伸ばし、テキストは、この例に示されているだけのよう、その範囲に収まる:

    [Setup] 
    AppName=My Program 
    AppVersion=1.5 
    DefaultDirName={pf}\My Program 
    
    [Code]  
    const 
        LoremIpsum = 
        'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin mauris ' + 
        'lorem, ullamcorper sit amet tincidunt ac, varius at ante. Aenean pretium, ' + 
        'tortor non congue pharetra, ante urna consectetur mi, vitae congue arcu est ' + 
        'eleifend nisl.'; 
    
    procedure InitializeWizard; 
    var 
        CustomPage: TWizardPage; 
        StandardDescLabel: TLabel; 
        StandardRadioButton: TNewRadioButton; 
        AdvancedDescLabel: TLabel; 
        AdvancedRadioButton: TNewRadioButton; 
    begin 
        CustomPage := CreateCustomPage(wpWelcome, 'Installation type', ''); 
        StandardRadioButton := TNewRadioButton.Create(WizardForm); 
        StandardRadioButton.Parent := CustomPage.Surface; 
        StandardRadioButton.Checked := True; 
        StandardRadioButton.Top := 16; 
        StandardRadioButton.Width := CustomPage.SurfaceWidth; 
        StandardRadioButton.Font.Style := [fsBold]; 
        StandardRadioButton.Font.Size := 9; 
        StandardRadioButton.Caption := 'Standard Installation' 
        StandardDescLabel := TLabel.Create(WizardForm); 
        StandardDescLabel.Parent := CustomPage.Surface; 
        StandardDescLabel.Left := 8; 
        StandardDescLabel.Top := StandardRadioButton.Top + StandardRadioButton.Height + 8; 
        StandardDescLabel.Width := CustomPage.SurfaceWidth; 
        StandardDescLabel.Height := 40; 
        StandardDescLabel.AutoSize := False; 
        StandardDescLabel.Wordwrap := True; 
        StandardDescLabel.Caption := LoremIpsum; 
        AdvancedRadioButton := TNewRadioButton.Create(WizardForm); 
        AdvancedRadioButton.Parent := CustomPage.Surface; 
        AdvancedRadioButton.Top := StandardDescLabel.Top + StandardDescLabel.Height + 16; 
        AdvancedRadioButton.Width := CustomPage.SurfaceWidth; 
        AdvancedRadioButton.Font.Style := [fsBold]; 
        AdvancedRadioButton.Font.Size := 9; 
        AdvancedRadioButton.Caption := 'Advanced Installation' 
        AdvancedDescLabel := TLabel.Create(WizardForm); 
        AdvancedDescLabel.Parent := CustomPage.Surface; 
        AdvancedDescLabel.Left := 8; 
        AdvancedDescLabel.Top := AdvancedRadioButton.Top + AdvancedRadioButton.Height + 8; 
        AdvancedDescLabel.Width := CustomPage.SurfaceWidth; 
        AdvancedDescLabel.Height := 40; 
        AdvancedDescLabel.AutoSize := False; 
        AdvancedDescLabel.Wordwrap := True; 
        AdvancedDescLabel.Caption := LoremIpsum; 
    end; 
    

    結果:

    enter image description here

  • +0

    [docs](http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/StdCtrls_TLabel_AutoSize.html)によれば、 'AutoSize'を' False'に設定する必要はありません。そして私はそれをテストしたところ、 'AutoSize'を' True'でうまく使っているようです。 – Ignitor

    +0

    @Ignitor、私はそこに保管します。ちょうどラベルが自動サイズ設定されるべき場合です。ドキュメントで言及されているように、* "テキストが変わるたびにラベルのサイズが再調整されます*"と私はそれを変更していますか? – TLama

    +0

    さて、質問が必要です。ラベルに自動的に高さを設定したくない場合は、 'AutoSize'を' False'に設定します。 'AutoSize:= True;'であっても、 'WordWarp'が有効になっているとき、ラベルはwidth__を調整しません。しかし、主に私が指摘したいのは、** WordWrap:= True'が動作するために 'AutoSize:= False'を設定する必要はありません**。 – Ignitor

    関連する問題