By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,032 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,032 IT Pros & Developers. It's quick & easy.

Detecting if a window is already open (MDI app)

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.