Close and Open MDI

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joachim

    Close and Open MDI

    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.
  • Herfried K. Wagner [MVP]

    #2
    Re: Close and Open MDI

    * "=?Utf-8?B?Sm9hY2hpbQ= =?=" <anonymous@disc ussions.microso ft.com> scripsit:[color=blue]
    > 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 ?[/color]

    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 ;-).
    [color=blue]
    > 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 ?[/color]

    Call the MDI parent's 'ActivateMdiChi ld' method and pass a reference to
    the MDI child that should be activated to this method.

    --
    Herfried K. Wagner [MVP]
    <URL:http://dotnet.mvps.org/>

    Comment

    • Joachim

      #3
      Re: Close and Open MDI

      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 'ActivateMdiChi ld' method
      And what reference should I pass ?

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

      Thanks in advance

      Regards,

      Comment

      Working...