473,395 Members | 1,986 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,395 software developers and data experts.

Detecting if a window is already open (MDI app)

I have an MDI application here and I would like to have one of the
windows only show once (maximize and get the focus if it has already
been created).

How can I check if a window already exists in an MDI app?

Thanks!

--
- Mitchell Vincent
Nov 21 '05 #1
2 1341
One way is to add a Module with a Boolean variable. When you go to create
an instance of the window, see if the variable is set to True. If it is,
just Activate the current instance of the window. If not, create a new
instance of the window and set the variable to True. You can set the
variable to false in the Closing event of the window.

"Mitchell Vincent" <mv******@newsgroup.nospam> wrote in message
news:uI**************@TK2MSFTNGP14.phx.gbl...
I have an MDI application here and I would like to have one of the windows
only show once (maximize and get the focus if it has already been created).

How can I check if a window already exists in an MDI app?

Thanks!

--
- Mitchell Vincent

Nov 21 '05 #2
Michael C# wrote:
One way is to add a Module with a Boolean variable. When you go to create
an instance of the window, see if the variable is set to True. If it is,
just Activate the current instance of the window. If not, create a new
instance of the window and set the variable to True. You can set the
variable to false in the Closing event of the window.


Kind of the idea I had - just wondered if there was some trick to it :-)

Thanks Michael!

--
- Mitchell Vincent
Nov 21 '05 #3

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

Similar topics

1
by: Mitchell Vincent | last post by:
I'm writing some business software, so I have a customer object that holds customer data and all the logic to deal with that customer. The problem is one of concept - I don't know how to tie the...
0
by: clu82 | last post by:
I have an MDI app that allows the user to open multiple client address child forms. The user has a child form open that has client id "1001" and the records associated data displayed. If the user...
0
by: Jon | last post by:
I am writing an MDI app that uses a document manager class to keep track of opened child windows. I want the user to be able to close a child window, but then re-open the window from the "Window"...
4
by: jm | last post by:
I can't find anything on the subject with C#. Thank you for any guidance. I want to create MDI windows within IE, not IE as a child window of something else.
0
by: Tom | last post by:
Here is a very strange problem that I am stumped by. I have a rather large application written in VB.NET (of course) using Framework 1.1. As you know, with an MDI application you can have multiple...
2
by: Prabhudhas Peter | last post by:
If I click a menu to open a form which already open...the vb.net opens a new window while existing open window is there...i want to restric the opening of a new instance of an already opened...
4
by: gabe | last post by:
i have a solution to gather the text in each window that is open, but would rather use only managed code rather than unmanaged code my current solution relies on. The purpose is to get the text in...
13
by: Academic | last post by:
I have a MDI form, sometimes child forms and sometimes forms that are neither If I close the app the child forms closing and closed event happens followed by the Mdi form receiving the...
1
by: mei1987 | last post by:
Hello all. I have created a MDI that loads an SDI when i click "Open" on the menu bar. Now i need to hold the Open command when/if i already have that child window opened. but when i do not have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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.