Inno Setup显示关于按钮以及网站超链接

方案一添加[Code]段,在此段下输入代码:

[Code]
procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox(‘您下载的文件来自于‘#13#13’织金旋律博客 www.zhijinxuanlv.com‘, mbInformation, mb_Ok);
end;

procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec(‘open’, ‘https://www.zhijinxuanlv.com/‘, ”, ”, SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure InitializeWizard();
var
AboutButton, CancelButton: TButton;
URLLabel: TNewStaticText;
begin
CancelButton := WizardForm.CancelButton;
AboutButton := TButton.Create(WizardForm);
AboutButton.Left := WizardForm.ClientWidth – CancelButton.Left – CancelButton.Width;
AboutButton.Top := CancelButton.Top;
AboutButton.Width := CancelButton.Width;
AboutButton.Height := CancelButton.Height;
AboutButton.Caption := ‘关于(&A)’;
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Parent := WizardForm;

URLLabel := TNewStaticText.Create(WizardForm);
URLLabel.Top := AboutButton.Top + AboutButton.Height – URLLabel.Height – 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
URLLabel.Caption := ‘织金旋律博客‘;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := WizardForm;
URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderLine];
URLLabel.Font.Color := clBlue;
URLLabel.Cursor := crHand;
end;

方案二添加[Code]段,在此段下输入代码:
[Code]
procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox(‘您下载的文件来自于’#13#13’织金旋律博客 www.zhijinxuanlv.com‘, mbInformation, mb_Ok);
end;
procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec(‘open’, ‘https://www.zhijinxuanlv.com‘, ”, ”, SW_SHOW, ewNoWait, ErrorCode)
end;
procedure InitializeWizard();
var
AboutButton: TButton;
URLLabel: TNewStaticText;
begin
AboutButton := TButton.Create(WizardForm);
AboutButton.Left := WizardForm.ClientWidth – WizardForm.CancelButton.Left – WizardForm.CancelButton.Width;
AboutButton.Top := WizardForm.CancelButton.Top;
AboutButton.Width := WizardForm.CancelButton.Width;
AboutButton.Height := WizardForm.CancelButton.Height;
AboutButton.Caption := ‘关于(&A)’;
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Parent := WizardForm;
URLLabel := TNewStaticText.Create(WizardForm);
URLLabel.Top := AboutButton.Top + AboutButton.Height – URLLabel.Height – 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + 10;
URLLabel.Caption := ‘织金旋律博客‘;
URLLabel.Font.Style := [fsBold, fsUnderline];
URLLabel.Font.Color := clBlue;
URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Font.Name := ‘宋体’;
URLLabel.Font.Height := ScaleY(-13);
URLLabel.Parent := WizardForm;
URLLabel.Hint := ‘织金旋律博客‘;
URLLabel.ShowHint := True;
end;
代码说明:
使用时请将代码中红色部分替换为自己想要的内容。
①:绿色代码部分是点击关于按钮后弹出的信息,#13为换行符。
②:紫色代码部分是点击超链接信息后转到的网站地址。
③:粉色代码部分为关于按钮的名称,(&A)为快捷键,可随意填写字母。
④:蓝色代码部分为超链接文字名称。
⑤:黄色代码部分为超链接文字名称颜色,clBlue 可改为其它颜色。如:
clBlack(黑色),clMaroon(暗红),clGreen(绿色),clOlive(橄榄绿),
clNavy(深蓝),clPurple(紫色),clTeal(深青),clGray(灰色),
clSilver(浅灰),clRed(红色),clLime(浅绿),clYellow(黄色),
clBlue (蓝色),clFuchsia(紫红),clAqua(青绿),clWhite(白色)。
⑥:红色代码部分为超链接文字名称字体,可修改为黑体字型等。
⑦:橙色代码部分为鼠标指针放到超链接文字标题上显示的提示语。
------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞1 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容