Image covering whole page in Inno Setup

前端 未结 1 914
小蘑菇
小蘑菇 2020-12-09 14:30

Following on from this: Inno Setup Placing image/control on custom page.

This is doing what I need:

Custom         


        
相关标签:
1条回答
  • 2020-12-09 14:58

    You can retrieve a size of the (custom) page surface using TWizardPage.SurfaceHeight and TWizardPage.SurfaceWidth.

    BtnImage.Height := CustomPage.SurfaceHeight;
    BtnImage.Width := CustomPage.SurfaceWidth;
    

    Though you will see that the (custom) page does not cover whole area between "header" (MainPanel) and "footer" (bottom part with buttons).


    If you want to display image across the whole area between "header" and "footer", you cannot place it on the (custom) page. You have to place it on the InnerPage (what is a parent control of all pages with the "header").

    BtnImage.Parent := WizardForm.InnerPage;
    
    BtnImage.Left := 0;
    BtnImage.Top := WizardForm.Bevel1.Top + 1;
    BtnImage.Width := WizardForm.InnerPage.ClientWidth;
    BtnImage.Height := WizardForm.InnerPage.ClientHeight - BtnImage.Top;
    

    But that way the image won't get automatically shown/hidden as the custom page shows/hides. You have to code it. Use CurPageChanged event function.

    procedure CurPageChanged(CurPageID: Integer);
    begin
      WizardForm.InnerNoteBook.Visible := (CurPageID <> CustomPage.ID);
      BtnImage.Visible := (CurPageID = CustomPage.ID);
    end;
    


    Similar questions:

    • Displaying an image even over the "header":
      How to hide the main panel and show an image over the whole page?
    • Displaying an image as a background of whole window: Inno Setup - Image as installer background.
    0 讨论(0)
提交回复
热议问题