Results 1 to 2 of 2

Thread: Use two MDI Form in the same Project

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2014
    Posts
    2

    Question Use two MDI Form in the same Project

    Hi,

    My Project start with Login Form. MDI_Main_Form open when Login is success. I want to open another MDIChildForm when I click an item in ToolStripMenu in MDI_Main_Form.

    Dim NewMDIChild As New Admin_Panel
    NewMDIChild.MdiParent = Me 'Error in this line. Admin_Panel is a MDIChild Form
    NewMDIChild.Show()
    NewMDIChild.Dock = DockStyle.Fill

    The Error Message is "Form cannot be both an MDI child and MDI parent"

    How can I solve this error?

    Thanks.

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,102

    Re: Use two MDI Form in the same Project

    That design doesn't make much sense. In the typical MDI scenario, one form acts as kind of a background and container for all other forms. From your description, MDI_Main_Form is the parent form, and Admin_Panel is a child form. However, based on the error, you have MDI_Main_Form as a child to something else, which it shouldn't be.
    My usual boring signature: Nothing

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width