Hello programmers! I am recently working on a college project where I have to develop a GUI app that simulates a very basic supermarket cashing system without Inventory database (basically you have to make up all the items you add) that will generate a on-screen sale invoice. The thing is that I want to add a "Printing, please wait..." window with a progress bar. I've tried implementing this by myself but I've failed to do it the way I want, I added a form wich there is a Ttimer (interval:=100) with a TprogressBar Below, this is the code I made for the progress bar to show, load, end and show the final form (and close the previous one) where the invoice is supposed show:
procedure TVentanaImprimiendoFactura.Timer1Timer(Sender: TObject);
begin
ProgressBar1.Position:=ProgressBar1.Position+5;
If ProgressBar1.Position=100 then
VentanaFactura.Show;
VentanaImprimiendoFactura.Close;
end;
I dont exactly know how Ttimer works, but when I try to Debug a second time and so on, the Invoice form will show seconds after I start the debug, also the form wont close when I press the X (close window button), or it closes but it opens again, I want the last form to be able to be closed so I can generate Invoices for other costumers.