Inno Setup:从另一个控件的 OnClick 事件访问自定义控件 [英] Inno Setup: Access to custom control from OnClick event of another control

查看:24
本文介绍了Inno Setup:从另一个控件的 OnClick 事件访问自定义控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 Inno Setup 的下一个代码:

I have next code for Inno Setup:

procedure CheckBoxClick(Sender: TObject);
begin
  { How to make BrowseButton visible from here? }
end;

procedure CreateTheWizardPage;
var
  Page: TWizardPage;
  BrowseButton, FormButton: TNewButton;
  CheckBox: TNewCheckBox;
  Memo: TNewMemo;
begin
  Page := PageFromID(wpReady);      
  BrowseButton := TNewButton.Create(Page);
  CheckBox := TNewCheckBox.Create(Page); 
  CheckBox.OnClick := @CheckBoxClick;
end;

我想知道如何从其中一个的处理程序过程中访问向导页面上的自定义控制器?

I'm wondering how can I access custom controllers on the wizard page from handler procedure for one of them?

推荐答案

你必须将 BrowseButton 变量设为全局变量并在事件处理程序之前定义它:

You have to make the BrowseButton variable global and define it before the event handler:

var
  BrowseButton: TButton;

procedure CheckBoxClick(Sender: TObject);
begin
  { Now you can use the BrowseButton here }
end;

procedure CreateTheWizardPage;
var
  Page: TWizardPage;
  FormButton: TNewButton;
  CheckBox: TNewCheckBox;
  Memo: TNewMemo;
begin
  Page := PageFromID(wpReady);      
  BrowseButton := TNewButton.Create(Page);
  CheckBox := TNewCheckBox.Create(Page); 
  CheckBox.OnClick := @CheckBoxClick;
end;

<小时>

相关问题:在不使用全局变量的情况下从自定义 Inno Setup 向导页面读取值

这篇关于Inno Setup:从另一个控件的 OnClick 事件访问自定义控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆