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 7523627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:51:29+00:00 2026-05-30T02:51:29+00:00

First off, a lil about me, i’m very new to GUI programming, especially with

  • 0

enter image description here

First off, a lil about me, i’m very new to GUI programming, especially with C++ Builder. i have a tframe that contains a row of cells, just like the picture above. there is a + button, and when pressed a cell is only added to the last column as shown. I was wondering if it is possible to change the size of the tframe during run time as the last column gets bigger and bigger. the tframe has to start off to be the size of one row of cells. there can be no scrollbar for this tframe. it simply has to expand in height as cells are added to the last column.

thanks in advanced.


more info.

here’s the coding for the tframe itself that adds the red cells (which is also another tframe jsut fyi). this tframe is also being added to a scroll box. for a better understanding refer to the picture in Tree Structure with TFrames. the ultimate goal is to create a tree structure of tframes.

the tframe in this particular quest is the tframe to the most right in the picture of the other question.

__fastcall TTreeTframe::TTreeTframe(TComponent* Owner)
    : TFrame(Owner)
{
    AddCells();
}
//---------------------------------------------------------------------------
void __fastcall TTreeTframe::AddCells()
{
    //this part adds the cells in the tframe (red boxes in the picture)
    int tempCellRow = 0;
    TCells* NewCellRow = new TCells (this);
    NewCellRow->Parent=this;

    TComponentEnumerator * ParentEnum = this->GetEnumerator();

    while(ParentEnum->MoveNext())
    {
        tempCellRow++;
    }

    NewCellRow->SetIndex(tempCellRow);
    NewCellRow->Name = "Cell" + IntToStr(tempCellRow);
    NewCellRow->Top = (NewCellRow->Height) * (tempCellRow-9);
    NewCellRow->Left = 213;
    NewCellRow->OnClose = &DeleteCell;
}

void __fastcall TTreeTframe::DeleteCell(TObject *Sender)
{
    //this part deletes the cells when the delete button is pressed. As 
    //mentioned the red boxes themselves are also tframe, and in that 
    //tframe is a TEdit with a delete button. just so u know where the 
    //delete button is located

    TCells* TCurrent = NULL;
    int CellRow = 0;
    TCells* NewCellRow = (TCells*)Sender;

    CellRow = NewCellRow->GetIndex();
    NewCellRow->Name = "";
    TComponentEnumerator * ParentEnum = NewCellRow->Parent->GetEnumerator();

    while(ParentEnum->MoveNext())
    {
        TCurrent = (TCells*)ParentEnum->GetCurrent();
        if(TCurrent->GetIndex() > CellRow )
        {
            TCurrent->SetIndex(TCurrent->GetIndex() - 1);
            TCurrent->Top -= (NewCellRow->Height);
            TCurrent->Name = "DistIPCell" + IntToStr(TCurrent->GetIndex());
        }
    }
}
//---------------------------------------------------------------------------
void __fastcall TTreeTframe::btnAddCellsClick(TObject *Sender)
{
    // this is what the red + does
    AddCells();
}
//---------------------------------------------------------------------------
// the rest of this is for the propose of deleting this tframe from the tree structure
void __fastcall TTreeTframe::btnRemoveClick(TObject *Sender)
{
    if (FOnClose != NULL)
    {
        FOnClose(this);
    }

    PostMessage(Handle, CM_RELEASE, 0, 0);
}
//---------------------------------------------------------------------------
void __fastcall TTreeTframe::WndProc(TMessage &Message)
{
    if (Message.Msg == CM_RELEASE)
    {
        delete this;
        return;
    }

    TFrame::WndProc(Message);
}
//---------------------------------------------------------------------------
void __fastcall TTreeTframe::SetIndex(int TypeRow)
{
    this->TypeRow = TypeRow;
}

int __fastcall TTreeTframe::GetIndex()
{
    return this->TypeRow;
}
//---------------------------------------------------------------------------

it’s a bit tricky to explain this, so if u need clarification just let me know, thanks.

  • 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-05-30T02:51:31+00:00Added an answer on May 30, 2026 at 2:51 am

    Like any other UI control, TFrame has published Width and Height properties available that you can set at design-time and at run-time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, i'm fairly new to programming, I've built a few asmx web services
First off I'm on Ubuntu linux if that matters. I have a simple project
First off I am pretty new to C, so I probably just have a
First off, I'm using Access 2000 and DAO. I have code that executes a
First off I should forewarn you that I am a new grad(and EE at
First off let me just say I'm very new to coding so there are
First off, I'll admit that I'm anal about such things. (Bad, bad, me.) However,
First off I would like to say that I have done ample research on
First off.. I am new to asp.net and EF. I have an EntityDatsource on
First off I'm new to Android and Java.. I have been trying to add

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.