我希望 bmp 图像出现在单个页面“selectadditionaltasks”上,但它出现在所有页面上。我究竟做错了什么?
procedure LogoOnClick(Sender: TObject);
var ResCode: Integer;
begin
end;
procedure LogoWizard();
var
BtnPanel: TPanel;
BtnImage: TBitmapImage;
begin
ExtractTemporaryFile('Logo.bmp')
BtnPanel:=TPanel.Create(WizardForm)
with BtnPanel do begin
Left:=40
Top:=250
Width:=455
Height:=42
Cursor:=crHand
OnClick:=@logoOnClick
Parent:=WizardForm
end
BtnImage:=TBitmapImage.Create(WizardForm)
with BtnImage do begin
AutoSize:=True;
Enabled:=False;
Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Logo.bmp')
Parent:=BtnPanel
end
end;
procedure InitializeWizard();
begin
LogoWizard();
end;
图像示例
通过设置一个Parent
你的BtnPanel
to the WizardForm
您是在告诉您,您希望该面板成为整个向导表单的直接子级。你必须改变BtnPanel.Parent
属性到您希望在其上显示该面板的页面表面。
因为您希望您的图像出现在选择附加任务向导页面,我能建议的最好方法是仅使用图像而不使用底层面板并调整大小TasksList
复选框,默认情况下它还覆盖页面的底部区域,您要在其中放置图像。这会执行以下脚本。您可以按照commented version https://stackoverflow.com/revisions/12939933/4该脚本的内容也是如此:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
[Files]
Source: "Logo.bmp"; Flags: dontcopy
[Tasks]
Name: associate; Description: "&Associate files"; Flags: unchecked
Name: desktopicon; Description: "Create a &desktop icon"; Flags: unchecked
[Code]
procedure LogoOnClick(Sender: TObject);
begin
MsgBox('Hello!', mbInformation, MB_OK);
end;
procedure InitializeWizard;
var
BtnImage: TBitmapImage;
begin
ExtractTemporaryFile('Logo.bmp');
BtnImage := TBitmapImage.Create(WizardForm);
with BtnImage do
begin
Parent := WizardForm.SelectTasksPage;
Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Logo.bmp');
AutoSize := True;
Left := 0;
Top := WizardForm.SelectTasksPage.Top + WizardForm.SelectTasksPage.Height -
Height - 8;
Cursor := crHand;
OnClick := @LogoOnClick;
end;
WizardForm.TasksList.Height :=
WizardForm.TasksList.Height - BtnImage.Height - 8;
end;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)