Inno setup bmp image appears on one page

I want the bmp image to appear on one page of "selectadditionaltasks", but it appears on all pages. What am I doing wrong?

procedure LogoOnClick(Sender: TObject); var ResCode: Integer; begin end; procedure LogoWizard(); var BtnPanel: TPanel; BtnImage: TBitmapImage; begin ExtractTemporaryFile('Logo.bmp') BtnPanel:=TPanel.Create(WizardForm) with BtnPanel do begin Left:=40 Top:=250 Width:=455 Height:=42 Cursor:=crHand OnClick: =@logoOnClick Parent:=WizardForm end BtnImage:=TBitmapImage.Create(WizardForm) with BtnImage do begin AutoSize:=True; Enabled:=False; Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Logo.bmp') Parent:=BtnPanel end end; procedure InitializeWizard(); begin LogoWizard(); end; 

Image example

Setup screenshot

+6
source share
1 answer

By setting the Parent your BtnPanel to the WizardForm that you are talking about, you want this panel to be an immediate child of the entire form of the wizard. You will need to change the BtnPanel.Parent property to the surface of the page on which you want to display this panel.

Since you want your image to appear on the "Select Additional Tasks" page, I can only offer the best image without a base panel and resize the TasksList check TasksList , which by default also covers the lower areas of the page where you want to place your image. And that makes the following script. You can follow the commented version this script:

 [Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}\My Program [Files] Source: "Logo.bmp"; Flags: dontcopy [Tasks] Name: associate; Description: "&Associate files"; Flags: unchecked Name: desktopicon; Description: "Create a &desktop icon"; Flags: unchecked [Code] procedure LogoOnClick(Sender: TObject); begin MsgBox('Hello!', mbInformation, MB_OK); end; procedure InitializeWizard; var BtnImage: TBitmapImage; begin ExtractTemporaryFile('Logo.bmp'); BtnImage := TBitmapImage.Create(WizardForm); with BtnImage do begin Parent := WizardForm.SelectTasksPage; Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Logo.bmp'); AutoSize := True; Left := 0; Top := WizardForm.SelectTasksPage.Top + WizardForm.SelectTasksPage.Height - Height - 8; Cursor := crHand; OnClick := @LogoOnClick; end; WizardForm.TasksList.Height := WizardForm.TasksList.Height - BtnImage.Height - 8; end; 
+4
source

Source: https://habr.com/ru/post/927964/


All Articles