Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
Reset a form
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
How can I capture all key...
by
Handoko
[
Today
at 05:21:56 am]
general reference manual ...
by
Curt Carpenter
[
Today
at 03:52:39 am]
Are We Dead Yet?
by
dbannon
[
Today
at 03:33:02 am]
Changes in "Search Result...
by
n7800
[
Today
at 03:13:36 am]
TBufferDataSet List Index...
by
eldonfsr
[
Today
at 01:54:18 am]
How to download a file fr...
by
jmpessoa
[
Today
at 01:44:30 am]
[SOLVED] LAMW BackButton ...
by
maurobio
[
Today
at 01:12:12 am]
any one knows how to set ...
by
dbannon
[
Today
at 01:10:22 am]
Clean up at ide/include/i...
by
Bart
[June 03, 2023, 11:03:10 pm]
Tips for deep debuging of...
by
Grew
[June 03, 2023, 10:46:22 pm]
discarding an array
by
robert rozee
[June 03, 2023, 09:54:10 pm]
TSynEdit crashes when loa...
by
Martin_fr
[June 03, 2023, 09:37:47 pm]
How to create form in thr...
by
PascalDragon
[June 03, 2023, 07:22:32 pm]
Who uses "caret past EOL"...
by
Martin_fr
[June 03, 2023, 06:34:39 pm]
array of array of type?
by
jamie
[June 03, 2023, 04:42:22 pm]
if then else syntax
by
jamie
[June 03, 2023, 04:37:44 pm]
how to do a HTTP POST wit...
by
rvk
[June 03, 2023, 03:51:05 pm]
[SOLVED] SynEdit resize t...
by
Hansvb
[June 03, 2023, 03:42:16 pm]
[SOLVED] Help for downloa...
by
magleft
[June 03, 2023, 11:32:31 am]
Two issues related to fcl...
by
wp
[June 03, 2023, 11:07:07 am]
ANN: ODBC DAC under GNU G...
by
Andrey Zubik
[June 03, 2023, 01:14:38 am]
LAMW - (SOLVED) simple es...
by
Mongkey
[June 03, 2023, 12:20:54 am]
Fast Base64 encoding/deco...
by
mika
[June 02, 2023, 10:53:10 pm]
help choosing laptop
by
Leledumbo
[June 02, 2023, 08:18:27 pm]
TStringGrid : Conflict be...
by
Nel_Fie
[June 02, 2023, 06:17:51 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Reset a form (Read 260 times)
MJ12
Newbie
Posts: 5
Reset a form
«
on:
December 11, 2022, 04:51:22 pm »
hello!
Im new to programming in general and I wanted to create the fifteen puzzle so copied the code from this link:
https://wiki.freepascal.org/15-puzzle
Everything worked fine but I wanted to implement a reset button. What i found online was this:
Form1.free;
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?
Logged
af0815
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
Logged
regards
Andreas
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
Reset a form
TinyPortal
© 2005-2018