-2

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.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490

1 Answers1

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
  • 1
    Total 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