Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8432429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:07:27+00:00 2026-06-10T06:07:27+00:00

I am trying to create a few checkboxes, how many is decided by the

  • 0

I am trying to create a few checkboxes, how many is decided by the recordcount of a query. Also i need to set the loction of the check box +38 from the previous location. Anyone give me some help with this? not sure how to create the checkboxes, The rest i should be able to do…anyhow he is what i have so far.

var
  i, top,left : integer;
begin
......
    left := 81;
    top := 119;
    while i < qry.RecordCount do
                  begin
                    // create check box
                    // set caption of checkbox to i
                    // set checkbox loction to left + 38, top
                    // left = left+38??
                  end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:07:29+00:00Added an answer on June 10, 2026 at 6:07 am

    After clarifying your needs, I would recommend you to use TObjectList as a container for your check boxes. This list can own the objects, what allows you to release them by a simple removing the item from the list either by Clear or by Delete. It also provides a simple access to each element by typecasting the obtained indexed item object to your known class type. More in the following untested pseudo-code:

    uses
      Contnrs;
    
    type
      TForm1 = class(TForm)
        procedure FormCreate(Sender: TObject);
        procedure FormDestroy(Sender: TObject);
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        CheckList: TObjectList;
      public
        { Public declarations }
      end;
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      CheckList := TObjectList.Create;
      // setting OwnsObjects to True will ensure you, that the objects
      // stored in a list will be freed when you delete them from list
      CheckList.OwnsObjects := True;
    end;
    
    procedure TForm1.FormDestroy(Sender: TObject);
    begin
      // this will also release all check boxes thanks to OwnsObjects
      CheckList.Free;
    end;
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
      I: Integer;
      CheckBox: TCheckBox;
    begin
      ...
      CheckList.Clear;                      // this will free all check boxes    
      for I := 0 to RecordCount - 1 do      // iterate over your recordset
      begin
        CheckBox := TCheckBox.Create(nil);  // be sure to use nil as an owner
        CheckBox.Parent := Self;            // where will be laying (Self = Form)
        CheckBox.Caption := IntToStr(I);    // caption by the iterator value
        CheckBox.Top := 8;                  // fixed top position
        CheckBox.Left := (I * 38) + 8;      // iterator value * 38 shifted by 8
        CheckBox.Width := 30;               // fixed width
        CheckList.Add(CheckBox);            // add the check box to the list
      end;
    end;
    
    procedure TForm1.Button2Click(Sender: TObject);
    begin
      // this will check the first check box from the list (be careful to indexes)
      TCheckBox(CheckList.Items[0]).Checked := True;
      // this will delete 3rd check box from the list (using Clear will delete all)
      CheckList.Delete(2);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a check on a few columns in my database that
I'm trying to create a fairly simple form that has a few checkboxes and
I've spent hours now trying to create a few charts in Excel from my
I'm trying to create a website in which I need to store a few
I'm trying to create a drop-down box with a few values. I don't want
In the spirit of re-using code, I'm trying to create a few library projects.
What i'm trying to create is a background worker that executes a few processes
I'm trying to create a script what permits me to select a few lines
I'm trying to learn JavaFX and maybe create a few learner games. I always
I have am trying to create a simple voting page. There are a few

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.