Author Topic: Reset a form  (Read 260 times)


  • Newbie
  • Posts: 5
Reset a form
« on: December 11, 2022, 04:51:22 pm »

Im new to programming in general and I wanted to create the fifteen puzzle so copied the code from this link:

Everything worked fine but I wanted to implement a reset button. What i found online was this:;
Application.CreateForm(TForm1, Form1)

I created the button and at the end i put the code but it was debugging infinitely.

Any ideas on how to make it work?


  • Hero Member
  • *****
  • Posts: 1205
Re: Reset a form
« Reply #1 on: December 11, 2022, 05:52:19 pm »
I think, you must not free and recreate the form. You have only to change/refresh the puzzle15 (TGameBoard)

a ) init all like in TGameBoard.Create (all old information is lost by this)
b ) Set new positions you can use TGameBoard.RandomArray



TinyPortal © 2005-2018