robin.do
...@dpi.nsw.gov.au wrote:
> They wish the app to calculate the result on
> the fly. That as the user enters the information.
Here's one generic style approach. All the calculations are performed
when the user Exits each of the Controls.
procedure TForm1.ediPriceWith1TaxExit(Sender: TObject);
begin
...
UpdateOtherValues(Sender);
end;
procedure TForm1.ediPriceWith2TaxExit(Sender: TObject);
begin
...
UpdateOtherValues(Sender);
end;
procedure TForm1.UpdateOtherValues(Sender: TObject);
begin
if (Sender = ediPriceWith2Tax) then
...
if (Sender = ediPriceWithTax2) then
...
if (Sender = ediPriceWithTax3) then
...
end;
The Sender parameter passes the information on which Control the OnExit
event has happened. And the contents of all the other Controls will be
updated accordingly.
As said, this is generic, pascal style. Someone may have more
sophisticated solution to this.
DB-1