editbox2.value := editbox1.value + editbox2.value;
invalidate;
place these two lines in the code where thecalculation is required. Invalidate will cause the editboxes to be re-diplayed with the current values. Note that the "value" tion is a place holder for whatever variable you are using to hold the value.
If you using a standard editbox and the value is stored in the caption property, the value name should change to caption. If you are using the caption rememeber that it is a string and you will have to convert the caption string to an integer or float value before the addition can be applied.
The first line would then read :
editbox2.caption := floatToStr (strToFloat (editbox1.caption)+ strToFloat(editbox2.caption));
if the value is an integer use strToInt & IntTostr functions. Also, remember to include sSysUtil in the Uses clause for the unit if it isn't already there.
Reputation Points: 11
Solved Threads: 11
Junior Poster in Training
Offline 68 posts
since Nov 2007