Вопрос Invisible and trasparent button

InstallationWay

Новичок
Hi Friends, is there any way to create an invisible button (transparent button) in inno setup (which can accept events like keypress, mouse hover etc)?
 

Вложения

  • Untitled-112.jpg
    Untitled-112.jpg
    53 KB · Просмотры: 20
is there any way implementing such a hidden area with a TLabel? if yes could you please provide a sample?

Код:
[Setup]
AppName=My Program
AppVersion=1.5
CreateAppDir=no
OutputDir=userdocs:Inno Setup Examples Output
PrivilegesRequired=lowest

[Code]
procedure LabelOnClick(Sender: TObject);
begin
  MsgBox('You found the Label!', mbInformation, mb_Ok);
end;

procedure CreateTheWizardPages;
var
  Page: TWizardPage;
begin
  { TLabel }

  Page := CreateCustomPage(wpWelcome, 'Custom wizard page controls', 'TButton and others');

  with TLabel.Create(Page) do
  begin
    Parent := Page.Surface;
    Anchors := [akLeft, akTop];
    Left := ScaleX(14);
    Top := ScaleY(14);
    Caption := 'Simple TLabel';
  end;

  with TLabel.Create(Page) do
  begin
    Parent := Page.Surface;
    Anchors := [akLeft, akTop];
    Left := ScaleX(14);
    Top := ScaleY(100);
    Font.Color := clBlue;
    Caption := 'Hidden TLabel (Find&&Click) --->';
  end;

  with TLabel.Create(Page) do
  begin
    Parent := Page.Surface;
    Anchors := [akLeft, akTop];
    Left := ScaleX(200);
    Top := ScaleY(80);
    Font.Size := -36;     // <-- size for hidden region
    Caption := '       '; // <-- text with only Spaces for hidden region
    OnClick := @LabelOnClick;
  end;
end;

procedure InitializeWizard();
begin
  { Custom wizard page }

  CreateTheWizardPages;

  { Custom beveled label }

  WizardForm.BeveledLabel.Caption := ' Label ';
end;

{ Changed current Page }
procedure CurPageChanged(CurPageID: Integer);
begin
  if PageIndexFromID(CurPageID) > PageIndexFromID(wpWelcome) then begin
    WizardForm.NextButton.Hide;
    WizardForm.CancelButton.Caption := 'Close';
  end;
end;

{ Disable confirm cancel }
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
  Confirm := False;
end;
 

Вложения

Is there any way to see label bounds (rectangle area with border) for test purposes?
In the example above, just add a panel (TPanel) and place this TLabel on it. :)

Why your setups will detect as virus?
Maybe you have a virus on your system?
Otherwise, inform your antivirus support service about a false positive.

Checked "Hidden_TLabel.exe" file on VirusTotal service.
So, I see three false positives detect from unknown companies.
In a month, another Noname Company will appear and reported about the virus. What's next?

Ultimately you have a script, compile it yourself.
 
Назад
Сверху