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

How to close a mon-modal window

P: n/a
Hi all,

I have a windows application in which I open a non-modal window on
click of button.
I want to close that window in case of an event raised on my
application.
This non-modal window is in different assembly than the assembly in
which the MDI form is.

So if there is a way to get a collection of instances of all the open
windows of the application then only the problem can be solved

Kindly help
Warm Regards
Sumit Vohra

Jan 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sumit wrote:
I have a windows application in which I open a non-modal window on
click of button.
I want to close that window in case of an event raised on my
application.
This non-modal window is in different assembly than the assembly in
which the MDI form is.

So if there is a way to get a collection of instances of all the open
windows of the application then only the problem can be solved


Why not just keep a reference to the window you open (or a list of
references if there could be several)? Subscribe to the window's Closed
event so you don't try to close it if it's already been closed, and
then when you need to close it, you'll know what to close.

Being in a different assembly shouldn't make any difference.

Jon

Jan 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.