| Re: Detecting open forms -
06-04-2007, 10:31 AM
"Raoul Watson" <EMAIL REMOVED> wrote in message
news:B7fXg.3279$HP.1206@trndny08...
> I have a form which should not be opened concurently with another form. Is
> there a way to detect if a form is already open? I cannot use the
statement:
>
> If Form1.Visible = True then ..
>
> because this statement actually will LOAD Form1 which is not what I want
to
> do.
>
> I can of course use a global variable as a flag to indicate a form is open
> and reset the flag on form unload and simply test for this flag, but any
> alternative or idea is greatly appreciated.
>
I rather prefer Karl's suggestion, but an alternative is to have each Form
define a common Mutex. Each form checks the Mutex on loading, if already
defined it exits.
-ralph |