loading one instance of a form to tabbed document list

3 posts, 0 answers
  1. Ren
    Ren avatar
    5 posts
    Member since:
    Dec 2007

    Posted 13 Jan 2008 Link to this post

    How can I load one instance of a form to the tabbed document list? I am current running this code.
        Private Sub newMDIRadButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles newMDIRadButton.Click
            Form5.MdiParent = Me
        End Sub
    but if I close the document from the tab and try to load it again, it doesn't work. Also, if I click the button one more time while the form5 loaded, it disappears.
  2. Julian Benkov
    Julian Benkov avatar
    1135 posts

    Posted 14 Jan 2008 Link to this post

    Hello Ren,

    When Form5 is loaded for the first time, the DocumentPane wrapper is created (Parent for Form5) and registered with the DockingManager. When Form5 is closed from the DockingManager, then only the parent (DocumentPane) is unregistered from the DockingManager. In this situation you may use the following code snippet:

    if (form.Parent == null)  
        form.MdiParent = this;  

    If you need any further assistance, please contact us.

    All the best,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Michael
    Michael avatar
    22 posts
    Member since:
    Jun 2012

    Posted 17 Jan 2008 Link to this post

    FYI, I was running into this situation earlier today when I came across the following article,


    I then changed the following code

    foreach (Form frm in this.MdiChildren) 

    to this

    foreach (Form f in dockingManager1.MdiChildren) 

    and everything works well.

    I hope this helps.

Back to Top