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

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

问题描述

我有用于Inno设置的下一个代码:

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天全站免登陆