Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not create label on Inno Setup Welcome page

I'm trying to create a label (or a bitmap) on the welcome page using this code:

LabelTarget := TLabel.Create(WizardForm);
with LabelTarget do
begin
  Parent := WizardForm.WelcomePage;
  Left := ScaleX(198);
  Top := ScaleY(105);
  Caption := 'Target';
end;

It won't work, but if I change the parent for example to WizardForm.InstallingPage it will create that label on Installing page. Where is the problem?

like image 332
Inside Man Avatar asked Nov 22 '25 22:11

Inside Man


1 Answers

It's because almost whole area of the WelcomePage is covered by an opaque WelcomeLabel2.

The TLabel is not a real Windows control. It is a virtual one, drawn by the form itself. So it gets hidden by any other real Windows control, even if the TLabel is technically on top of it (what it is, as your LabelTarget is created later than the WelcomeLabel2). The WelcomeLabel2 is TStaticText, what is a real control. So it hides your LabelTarget.

To solve this either:

  • Shrink the WelcomeLabel2 height, or
  • Change your LabelTarget to TStaticText.
like image 73
Martin Prikryl Avatar answered Nov 26 '25 06:11

Martin Prikryl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!