MSFN Forum: [How to] Checkbox :: Select one at a time - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

Welcome to the Applications Installs forum. Make sure you read the forum rules before you start posting.

Links/Requests to warez and/or any illegal material (porn, cracks, serials, etc..) will not be tolerated. Discussion of circumventing WGA/activation/timebombs/keygens or any other illegal activity will also not be tolerated.

We try our best to keep this forum clean of illegal content. If you see any illegal activity use the "report" button you find in every post to report the specific post to the moderators. If you ignore any of the rules you will be banned without notice.

Read Forum Rules
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[How to] Checkbox :: Select one at a time Rate Topic: -----

#1 User is offline   enlighten 

  • Group: Members
  • Posts: 3
  • Joined: 29-March 10
  • OS:none specified
  • Country: Country Flag

Posted 01 April 2010 - 09:49 PM

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]
var
Box2,CheckBox: TCheckBox;    //Yes global variable.

procedure CheckBoxOnClick(Sender: TObject);
begin
if Checkbox.Checked then   //generate error
BEGIN
   CheckBox.State := cbUnchecked;
   Box2.State := cbChecked;
END else
BEGIN
   CheckBox.State := cbChecked;
   Box2.State := cbUnchecked;
END;
end;

procedure Box2OnClick(Sender: TObject);
begin
if Box2.Checked then      //generate error
BEGIN
   CheckBox.State := cbChecked;
   Box2.State := cbUnchecked;
END else
BEGIN
   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..

This post has been edited by enlighten: 04 April 2010 - 12:49 AM



Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy