PC Review


Reply
Thread Tools Rate Thread

Closing child forms in MDI parent one?

 
 
al
Guest
Posts: n/a
 
      14th Dec 2003
Greetings,

If I instansiate child forms in MDI parent, what is the way to close
them. I can't find an event related to child to do such task. I want
to close 3 child forms, all in the same parent.

MTIA,
Grawsha
 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      14th Dec 2003
"al" <(E-Mail Removed)> schrieb
>
> If I instansiate child forms in MDI parent, what is the way to
> close them. I can't find an event related to child to do such task.
> I want to close 3 child forms, all in the same parent.


The MdiChildren property of the parent returns a list of all open Mdi child
windows. Each child has also a Close event you can handle.


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      14th Dec 2003
* (E-Mail Removed) (al) scripsit:
> If I instansiate child forms in MDI parent, what is the way to close
> them. I can't find an event related to child to do such task. I want
> to close 3 child forms, all in the same parent.


\\\
Me.MdiChildren(2).Close()
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
al
Guest
Posts: n/a
 
      15th Dec 2003
hirf-spam-me-(E-Mail Removed) (Herfried K. Wagner [MVP]) wrote in message news:<#(E-Mail Removed)>...
> * (E-Mail Removed) (al) scripsit:
> > If I instansiate child forms in MDI parent, what is the way to close
> > them. I can't find an event related to child to do such task. I want
> > to close 3 child forms, all in the same parent.

>
> \\\
> Me.MdiChildren(2).Close()
> ///


This is not exactly what I want.It is what event/s I should use in the
MDIparent or any other to triger the closing of the child forms. That
is,

'What event I should use to trigger this event?
> Me.MdiChildren(2).Close()

 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      15th Dec 2003
"al" <(E-Mail Removed)> schrieb
> This is not exactly what I want.It is what event/s I should use in
> the MDIparent or any other to triger the closing of the child forms.
> That is,
>
> 'What event I should use to trigger this event?
> > Me.MdiChildren(2).Close()



"Each child has also a Close event you can handle."


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      15th Dec 2003
* (E-Mail Removed) (al) scripsit:
>>> If I instansiate child forms in MDI parent, what is the way to close
>>> them. I can't find an event related to child to do such task. I want
>>> to close 3 child forms, all in the same parent.

>>
>> \\\
>> Me.MdiChildren(2).Close()
>> ///

>
> This is not exactly what I want.It is what event/s I should use in the
> MDIparent or any other to triger the closing of the child forms. That
> is,
>
> 'What event I should use to trigger this event?
>> Me.MdiChildren(2).Close()


That's not an event, that's a method call. Call it where you want to
close the form, for example in a button's 'Click' event handler.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      15th Dec 2003
"Armin Zingler" <(E-Mail Removed)> schrieb
> "al" <(E-Mail Removed)> schrieb
> > This is not exactly what I want.It is what event/s I should use
> > in the MDIparent or any other to triger the closing of the child
> > forms. That is,
> >
> > 'What event I should use to trigger this event?
> > > Me.MdiChildren(2).Close()

>
>
> "Each child has also a Close event you can handle."


Excuse me please, it is the Closed event, not the Close event. Close is a
method.


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call a parent form function when the child is closing dave b via AccessMonster.com Microsoft Access Form Coding 1 6th Apr 2006 06:00 PM
stop a MDI child form from closing if parent is trying to close JohnR Microsoft VB .NET 1 17th Dec 2005 07:21 AM
Closing a MDI Child from the MDI parent throws an exception =?Utf-8?B?dnZlbms=?= Microsoft VB .NET 4 19th Jul 2005 12:25 PM
Weird Problem: Closing MDI Parent re-directed to MDI Child Charles Law Microsoft VB .NET 10 14th Jun 2004 06:29 PM
Closing Modal child dialog causes parent window to close JerryK Microsoft Dot NET Framework Forms 2 17th Sep 2003 01:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:40 PM.