I am obviously new to Delphi but I just cant seem to figure this simple in out. I need to be able to click the button ' Total for the day ' and this should add the 3 spinedit values and display the total in a List Box.
Asked
Active
Viewed 307 times
-2
-
Please add some code here with what you have tried. – Daniel Dudas Aug 22 '16 at 11:38
-
What you need to do is use your IDE or text editor, and write some code. It's off topic to come here and ask us to do your homework for you. – David Heffernan Aug 22 '16 at 11:50
-
Its unnecessary to be rude, I was asking a question just like anyone else here – user6743317 Aug 22 '16 at 12:49
-
The fact that there is no code, and a simple task, implies this is homework. If you had code, you'd have shown it. Did you visit the [help] yet? – David Heffernan Aug 22 '16 at 15:30
1 Answers
1
I dont have Delphi at hand here so I am not sure if SpinEdit.Value is an integer or not, but this should get you on your way:
var
Total: integer;
begin
Total := SpinEdit1.Value + SpinEdit2.Value + SpinEdit3.Value;
// now just display Total wherever you want...
...

GuidoG
- 11,359
- 6
- 44
- 79
-
Thank you for your input, thats the code I have and now I just need to display the Total in the Listbox but its not displaying . Ive done this Listbox.Items.Add(Total); – user6743317 Aug 22 '16 at 13:01
-
1Total in my example is an integer, if you want to display it in a listbox you will have to convert it to s string: Listbox.Items.Add(IntTostr(Total)); – GuidoG Aug 22 '16 at 14:03