We help IT Professionals succeed at work.
Get Started

Accessing Value of Control object in BCB

prutovitz
prutovitz asked
on
211 Views
Last Modified: 2011-08-18
I have a GroupBox with a number of DBEdit fields identified by Tag being set to 1. I simply want to add the values of the DBEdit fields together and store them in a TEdit field. The code is attached.
 
It does not work, but I think this is the way I need to do it; to cast the control to TDBEdit. Can anyone help me out here?

Thanks,

Phil

for (i = 0; i < BudgetGroupBox->ControlCount; i++)
        {
        if (BudgetGroupBox->Controls[i]->Tag == 1)
                {
                tot = tot + StrToFloat(<TDBEdit *> (BudgetGroupBox->Controls[i])->Text);
                } // if (BudgetGroupBox->Controls[i]->Tag == 1)
        } // for (i = 0; i < BudgetGroupBox->ControlCount; i++)

Open in new window

Comment
Watch Question
President
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE