473,410 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

How can I check that if the form is already open?

Hi,
how can I check that if the form is already open?
Whenever I click on a button, it will open the form.
I would like to check if the form is open.
Nov 20 '05 #1
3 10573
You can have as many instances of a given form created/open as you want
(memory allowing). You may want to implement a Singleton pattern
http://www.yoda.arachsys.com/csharp/singleton.html to limit the instances
but short of that, it's hard to say b/c there's not just one instance of a
given form to check for.

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/...ity/newsgroups
"Shelby" <sh****@itsupport.com.sg> wrote in message
news:eX**************@TK2MSFTNGP11.phx.gbl...
Hi,
how can I check that if the form is already open?
Whenever I click on a button, it will open the form.
I would like to check if the form is open.

Nov 20 '05 #2
Assume that the form that you want to check on is Form2. In the Click
event of the button (on Form1)

If Form2 Is Nothing OrElse Not Form2.Loaded Then Form2.Load

HTH

David

"Shelby" <sh****@itsupport.com.sg> wrote in message
news:eX**************@TK2MSFTNGP11.phx.gbl:
Hi,
how can I check that if the form is already open?
Whenever I click on a button, it will open the form.
I would like to check if the form is open.


Nov 20 '05 #3
Shelby,

I prefer it to disable the button when a form is opened and when it is
closed to enable the button again.

Cor
Nov 20 '05 #4

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

Similar topics

1
by: ST | last post by:
This is my other error when I click on Immunoflourescence. I believe this is related to the other error I just posted (Input string was not in a correct format.) Please let me know if you have...
3
by: P | last post by:
Hi, Access 2002. I use DoCmd.OpenForm attached to command buttons to open one form from another form. All forms are open in dialog mode. When a user tries to open a form already opened from a...
2
by: nTn | last post by:
Hi! I open a new form in my Mdi. But if I click in button again to open this form, the program create another form. How I can check if the form is already open? I'm using that: Dim...
2
by: John | last post by:
Hi I am opening a dialog using; frmdialog = New frmdialognew frmdialog.ShowDialog() Is there a way to see if this dialog is already open to avoid opening multiple instances of it?
9
by: KelsMckin | last post by:
Hello, I was wondering if there was a way to check there was already a form open before opening a new one, sorry that doesnt seem clear, here is an example: The following button opens a new form...
1
by: stevencarroll19 | last post by:
What i wnat to do is check to see if a form is open before a new record can be entered. If any of the forms are open ( Question3 Reason, Question 4 Reason and Question 9 Comments) I want an error...
1
by: keri | last post by:
Hi, I use the below for the user to view their outlook calendar Sub DisplayInbox() Dim myolApp As Outlook.Application Dim myNameSpace As Outlook.NameSpace Dim myFolder As Outlook.MAPIFolder...
19
by: =?Utf-8?B?R3JlZw==?= | last post by:
How can I tell via code if a Form is already open. Each time my forms load I have some initialization code that runs, but if the form is already open and hidden I don't want that initialization...
2
by: KA NMC | last post by:
Current application is built in VB.net 2005 what it does is open other small applications within the form. I'm not using mdi I probably should. Here is my problem The application load - main...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.