Board index » delphi » prevent multiple instances of a form

prevent multiple instances of a form

I'm sure I've seen the answer to this somewhere, but of course I cannot
find it when I need it.

I need to prevent the user from opening multiple instances of a form.
How do I test to see if the form is already open?

Thanks!

Sent via Deja.com http://www.deja.com/
Before you buy.

 

Re:prevent multiple instances of a form


There is a FREEWARE component called " Just One" at
http://www.utilmind.com/delphi/justone.zip
that will do the trick for you.

In article <877b47$ta...@nnrp1.deja.com>,

Quote
  j...@cuttingedgemedia.com wrote:
> I'm sure I've seen the answer to this somewhere, but of course I
cannot
> find it when I need it.

> I need to prevent the user from opening multiple instances of a form.
> How do I test to see if the form is already open?

> Thanks!

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.

Re:prevent multiple instances of a form


If you make sure that your form pointer (say Form1: TForm1) is always
nil when not created, you can check if Form1 is instanciated or not ( if
not assigned( Form1 ) then... ). Of course always assign nil to Form1
after you have freed it.

Regards,
  Erik Akkermans

In article <877b47$ta...@nnrp1.deja.com>,

Quote
  j...@cuttingedgemedia.com wrote:
> I'm sure I've seen the answer to this somewhere, but of course I
cannot
> find it when I need it.

> I need to prevent the user from opening multiple instances of a form.
> How do I test to see if the form is already open?

> Thanks!

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.

Other Threads