【问题标题】:How to hide the main panel and show an image over the whole page?如何隐藏主面板并在整个页面上显示图像?
【发布时间】:2016-08-01 03:29:09
【问题描述】:

我创建了一个带有图像的自定义欢迎页面,但顶部的主面板仍有待显示。对于我想要实现的目标,请参见下图:

代码如下:

[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;

如何在隐藏主面板的情况下在整个页面上显示图像?

【问题讨论】:

标签: inno-setup


【解决方案1】:

您需要在切换到欢迎页面时隐藏Bevel1MainPanelInnerNotebook 组件,并在离开时再次显示它们。相反,只有在显示欢迎页面时才需要显示图像,因为它覆盖了整个页面区域。所以下面的代码就可以了:

[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;

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-06-29
  • 2020-06-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-02-16
  • 1970-01-01
相关资源
最近更新 更多