How to hide the main panel and show the image on the whole page?

I created a custom welcome page with an image on it, but the main panel at the top remains displayed. Why do I want to get the image below:

enter image description here

Here is the code:

[Code] procedure InitializeWizard; var BitmapFileName: string; BitmapImage: TBitmapImage; WelcomePage: TWizardPage; begin WelcomePage := CreateCustomPage(wpWelcome, '', ''); BitmapFileName := ExpandConstant('{tmp}\DataNova_Logo.bmp'); ExtractTemporaryFile(ExtractFileName(BitmapFileName)); BitmapImage := TBitmapImage.Create(WelcomePage); BitmapImage.AutoSize := True; BitmapImage.Bitmap.LoadFromFile(BitmapFileName); BitmapImage.Cursor := crHand; BitmapImage.Left := 10; BitmapImage.Top := 10; BitmapImage.Parent := WelcomePage.Surface; end; 

How to show the image on the whole page with a hidden main panel?

+5
inno-setup
Jun 21 '12 at 16:44
source share
1 answer

You need to hide the Bevel1 , MainPanel and InnerNotebook when you switch to your welcome page and show them again when you leave it. Conversely, an image needs to be shown only when you show your welcome page, as it covers the entire area of ​​the page. Thus, the following code will do the trick:

 [Code] var WelcomePageID: Integer; BitmapImage: TBitmapImage; procedure InitializeWizard; var WelcomePage: TWizardPage; begin WelcomePage := CreateCustomPage(wpWelcome, '', ''); WelcomePageID := WelcomePage.ID; BitmapImage := TBitmapImage.Create(WizardForm); BitmapImage.Bitmap.LoadFromFile('C:\Image.bmp'); BitmapImage.Top := 0; BitmapImage.Left := 0; BitmapImage.AutoSize := True; BitmapImage.Cursor := crHand; BitmapImage.Visible := False; BitmapImage.Parent := WizardForm.InnerPage; end; procedure CurPageChanged(CurPageID: Integer); begin BitmapImage.Visible := CurPageID = WelcomePageID; WizardForm.Bevel1.Visible := CurPageID <> WelcomePageID; WizardForm.MainPanel.Visible := CurPageID <> WelcomePageID; WizardForm.InnerNotebook.Visible := CurPageID <> WelcomePageID; end; 
+7
Jun 22 '12 at 12:35
source share



All Articles