我有 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;
我想知道如何从其中之一的处理程序过程访问向导页面上的自定义控制器?
您必须将
BrowseButton
变量设为全局变量并在事件处理程序之前定义它:
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;