473,474 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Detecting open forms

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.

Thanks and God Bless.
_Raoul
Oct 11 '06 #1
3 4764
Raoul Watson wrote:
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.
How's about looping the Forms collection, and looking for identifiable
characteristics?
--
Oct 11 '06 #2

"Raoul Watson" <Wa*****@IntelligenCIA.comwrote 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
Oct 12 '06 #3
Thanks Karl & Ralph for a good alternative..
Oct 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Frances Del Rio | last post by:
pls, why is this not working? <SCRIPT language=JavaScript type="text/javascript"> var br = '<SCRIPT language=Javascript' br += 'src="js_pop.js" type="text/javascript">' br += '</SCRIPT>' var...
13
by: dave yan | last post by:
hi, i have some forms which use javascript for data validation, e.g., checking to make sure all required fields are completed, checking that data falls within valid ranges for certain fields,...
3
by: raptor | last post by:
hi, how to detect opera..it seems that even opera8 doesnt support xmlhttp fully (.i.e. sendRequestHeader). I ask this 'cause opera seems to mimic IE, at least in the preferences ?! I havent...
8
by: Les Desser | last post by:
Is there any way to detect within A97 when Windows is trying to shut down, so I can close down the application gracefully? We currently have a trap in the main menu asking the user to confirm if...
2
by: Lumpierbritches | last post by:
Thank you in advance for your assistance. I would like to know if there's a way to detect if NO form is open, so the Switchboard is opened and not leaving a user with no interface in the...
2
by: Deano | last post by:
In my app I have lots of forms with data presented in various ways using all kinds of controls. Is there a simple way of detecting if the user has changed any data? I would like to do this so I...
27
by: Deek | last post by:
I have a target(graphic) that moves via, i am trying to detect a hit of the target with and essay(copied below) my prof gave us, but I am not sure what to do, if you could get me going in the...
1
by: Phill W. | last post by:
Is there any way for a Form to detect that it has a Modal dialog displayed "above" it and to get hold of a reference with which to manipulate that dialog? I have a Windows Forms application that...
1
by: Joza | last post by:
Hi! I have MDI and two forms, Form1 and Form2. If I open From1 and then Form2 how to detected from Form1 that Form2 is also opened?! Is that possible?! Thnx. J.
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.