enlighten Posted April 2, 2010 Posted April 2, 2010 (edited) This is the code section from inno setup.My intention is to make two Checkbox where at a time one is being selected.But this code return error when first checkbox is clicked. section: [Code]varBox2,CheckBox: TCheckBox; //Yes global variable.procedure CheckBoxOnClick(Sender: TObject);beginif Checkbox.Checked then //generate errorBEGIN CheckBox.State := cbUnchecked; Box2.State := cbChecked;END elseBEGIN CheckBox.State := cbChecked; Box2.State := cbUnchecked;END;end;procedure Box2OnClick(Sender: TObject);beginif Box2.Checked then //generate errorBEGIN CheckBox.State := cbChecked; Box2.State := cbUnchecked;END elseBEGIN CheckBox.State := cbUnchecked; Box2.State := cbChecked;END;end;procedure CreateTheWizardPages;var Page: TWizardPage;begin Page := CreateCustomPage(wpWelcome, 'Support Us', 'If you like this package ,then please support us.'); CheckBox := TCheckBox.Create(Page); CheckBox.Top :=ScaleY(8)+ScaleX(50); CheckBox.Width := Page.SurfaceWidth; CheckBox.Height := ScaleY(17); CheckBox.Caption := 'Do this'; CheckBox.Checked := True; CheckBox.OnClick := @CheckBoxOnClick; CheckBox.Parent := Page.Surface; Box2 := TCheckBox.Create(Page); Box2.Top :=ScaleY(8)+ScaleX(70); Box2.Width := Page.SurfaceWidth; Box2.Height := ScaleY(17); Box2.Caption := 'No,Thanks.'; Box2.Checked := False; Box2.OnClick := @Box2OnClick; { } Box2.Parent := Page.Surface;end;procedure InitializeWizard();begin { Custom wizard pages } CreateTheWizardPages;end;Returns an error on firstbox click named: Access violation at address 00444400. Write of address 011ABFF8.Please tell me where to change.. Edited April 4, 2010 by enlighten
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now