Board index » cppbuilder » Re: UsingLabelsToMultiplyEditText?

Re: UsingLabelsToMultiplyEditText?


2006-11-07 07:12:11 AM
cppbuilder2
How about using the OnExit event for the edits...
void __fastcall TForm1::Edit1Exit(TObject *Sender)
{
if(!Edit1->Text.IsEmpty() && !Edit2->Text.IsEmpty())
{
// this could be in a function, since it is used more
// than once...
Label4->Caption = FloatToStr( StrToFloat(Edit1->Text) *
StrToFloat(Edit2->Text) );
}
}
void __fastcall TForm1::Edit2Exit(TObject *Sender)
{
if(!Edit1->Text.IsEmpty() && !Edit2->Text.IsEmpty())
{
// this could be in a function, since it is used more
// than once...
Label4->Caption = FloatToStr( StrToFloat(Edit1->Text) *
StrToFloat(Edit2->Text) );
}
}
... or something like that.
HTH,
Bud
 
 

Re:Re: UsingLabelsToMultiplyEditText?

Will give your idea a try too, Bud, thank you. It's coming back but I sure
need to do a lot more reading and larning!!!!
Verne