Close and Open MDI

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

1. I am sure there is a way to close the ChildForm from ParentForm

Example
I have several (song) albums. Each album has several songs
So.... Album is my ParentForm and each song has each ChildForm (6 songs = 6 ChildForm)
(Album = Directory, Song = file)
When I change the album (to albumX), I will that all the ChildForms those belong to the Album, to be closed
And then open all the Song/ChildForm of the new album (albumX)
Can anybody tell me how to do it

2. If I open a ChildForm that already opened, I want to show a message and Set the ChildForm Active
How can I do this

Thansk in advance for help

Regards
Joachim.
 
* "=?Utf-8?B?Sm9hY2hpbQ==?= said:
1. I am sure there is a way to close the ChildForm from ParentForm.

Example :
I have several (song) albums. Each album has several songs.
So.... Album is my ParentForm and each song has each ChildForm (6 songs = 6 ChildForm).
(Album = Directory, Song = file).
When I change the album (to albumX), I will that all the ChildForms those belong to the Album, to be closed.
And then open all the Song/ChildForm of the new album (albumX).
Can anybody tell me how to do it ?

Loop through the MDI parent's 'MdiChildren' collection and close all
forms that belong to the album. It's likely that you will need to use
the 'DirectCast' operator ;-).
2. If I open a ChildForm that already opened, I want to show a message and Set the ChildForm Active.
How can I do this ?

Call the MDI parent's 'ActivateMdiChild' method and pass a reference to
the MDI child that should be activated to this method.
 
Thanks Herfried for your reply

Sorry to tell you that I am a beginner in VB.NET, so I don't really know much
Can you please explain it with a code sample

How to loop the MDI parent's 'MdiChildren' collection
How to close it ? With which statement, parameter
'DirectCast' operator, what is this

How to call the MDI parent's 'ActivateMdiChild' method
And what reference should I pass ?

Again. Sorry Herfried. I am a beginner
So please give a code sample

Thanks in advance

Regards,
 
Back
Top