2017-09-12 43 views

回答

2

PageNameLabelPageDescriptionLabelTNewStaticText組件。該組件不支持透明度。儘管TLabel組件具有相似的功能,但它確實支持透明度(in Unicode version of Inno Setup only)。

因此,您可以用TLabel等效替換這兩個組件。然後,您需要確保,每當Inno安裝程序更新原始組件時,新的自定義組件的標題都會更新。對於這兩個組件,這很容易,因爲它們只在頁面更改時纔會更新。因此,您可以從​​更新您的自定義組件。

function CloneStaticTextToLabel(StaticText: TNewStaticText): TLabel; 
begin 
    Result := TLabel.Create(WizardForm); 
    Result.Parent := StaticText.Parent; 
    Result.Left := StaticText.Left; 
    Result.Top := StaticText.Top; 
    Result.Width := StaticText.Width; 
    Result.Height := StaticText.Height; 
    Result.AutoSize := StaticText.AutoSize; 
    Result.ShowAccelChar := StaticText.ShowAccelChar; 
    Result.WordWrap := StaticText.WordWrap; 
    Result.Font := StaticText.Font; 
    StaticText.Visible := False; 
end; 

var 
    PageDescriptionLabel: TLabel; 
    PageNameLabel: TLabel; 

procedure InitializeWizard(); 
begin 
    { ... } 

    { Create TLabel equivalent of standard TNewStaticText components } 
    PageNameLabel := CloneStaticTextToLabel(WizardForm.PageNameLabel); 
    PageDescriptionLabel := CloneStaticTextToLabel(WizardForm.PageDescriptionLabel); 
end; 

procedure CurPageChanged(CurPageID: Integer); 
begin 
    { Update the custom TLabel components from the standard hidden components } 
    PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption; 
    PageNameLabel.Caption := WizardForm.PageNameLabel.Caption; 
end; 

enter image description here


比較容易的方式是改變原來的標籤背景色:
Inno Setup - Change size of page name and description labels

+2

呀。我安裝了Unicode版本的Inno Setup,一切正常。謝謝你的一切。 –