问题
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?
回答1:
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;
Related question: Reading values from custom Inno Setup wizard pages without using global variables
来源:https://stackoverflow.com/questions/36839988/inno-setup-access-to-custom-control-from-onclick-event-of-another-control