I want to add custom designed buttons to my Inno Script with the TBitmapImage
class.
My Inno Setup script is compiling just fine but the bitmap isn't showing in the form. I looked into any possibilities but can't seem to find the error I made. That's how the TBitmapImage
part looks like atm:
procedure CreateMuteButton(ParentForm: TSetupForm);
var
MuteImage: TBitmapImage;
BitmapFileName: String;
begin
BitmapFileName := ExpandConstant('{tmp}\muteBtn.bmp');
ExtractTemporaryFile(ExtractFileName(BitmapFileName));
MuteImage := TBitmapImage.Create(ParentForm);
MuteImage.Bitmap.LoadFromFile(BitmapFileName);
MuteImage.Cursor := crHand;
MuteImage.OnClick := @MuteButtonOnClick;
MuteImage.Parent := ParentForm;
MuteImage.Left := 45;
MuteImage.Top := 80
MuteImage.Width := 38;
MuteImage.Height := 50;
end;
procedure InitializeWizard();
var
val: Integer;
begin
CreateMuteButton(WizardForm);
(...)
end;
The WizardForm
client area itself is only visible below the bottom bevelled line. Above that is WizardForm.InnerPage
, and the individual/current Wizard pages in the middle contained in a private InnerNotebook
.
This puts the image to the left of the pages:
MuteImage := TBitmapImage.Create(WizardForm.InnerPage);
MuteImage.Parent := WizardForm.InnerPage;
MuteImage.Left := 0;
{ Uses the top of the wizard pages to line up }
MuteImage.Top := WizardForm.SelectDirPage.Parent.Top;
Whereas this puts it in the bottom section:
MuteImage := TBitmapImage.Create(WizardForm);
MuteImage.Parent := WizardForm;
MuteImage.Left := 0;
{ Below the inner page }
MuteImage.Top := WizardForm.InnerPage.Height;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With