I'm trying to have an image on a custom page I can get the custom page to show or the image on a predefined page but not on the custom page.
Problem I think is with Parent := CustomPage.ID;
.
Parent := WizardForm.SelectTasksPage;
works though.
How to do this properly?
procedure ImageOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('', 'http://test.com', '', '', SW_SHOW, ewNoWait, ErrorCode);
end;
var
CustomPage: TWizardPage;
BtnImage: TBitmapImage;
procedure InitializeWizard;
begin
CustomPage := CreateCustomPage(wpLicense, 'Heading', 'Sub heading.');
ExtractTemporaryFile('image.bmp');
BtnImage := TBitmapImage.Create(WizardForm);
with BtnImage do
begin
Parent := CustomPage.ID;
Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'image.bmp');
AutoSize := True;
Left := 90;
Top := WizardForm.SelectTasksPage.Top +
WizardForm.SelectTasksPage.Height - Height - 8;
Cursor := crHand;
OnClick := @ImageOnClick;
end;
end;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…