Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. MDI form...

MDI form...

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
8 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    manni_n
    wrote on last edited by
    #1

    example: suppose i have 3 forms and sequence of opening is form1->form2->form3 form1 is MDi parent, form3 is MDi child on clickin of form1, form2 gets open which takes some values from user retreives the data and accordingly opens form 3.. ma doubt is from form1, form2 can b made mdi child but from form 2, how form3 will b made child of form1..??? thanks

    M 1 Reply Last reply
    0
    • M manni_n

      example: suppose i have 3 forms and sequence of opening is form1->form2->form3 form1 is MDi parent, form3 is MDi child on clickin of form1, form2 gets open which takes some values from user retreives the data and accordingly opens form 3.. ma doubt is from form1, form2 can b made mdi child but from form 2, how form3 will b made child of form1..??? thanks

      M Offline
      M Offline
      mr_lasseter
      wrote on last edited by
      #2

      From form2 use the following

              Dim form As New Form3
              form.MdiParent = Me.MdiParent
              form.Show()
      

      -- modified at 21:24 Tuesday 9th October, 2007

      Mike Lasseter

      M 1 Reply Last reply
      0
      • M mr_lasseter

        From form2 use the following

                Dim form As New Form3
                form.MdiParent = Me.MdiParent
                form.Show()
        

        -- modified at 21:24 Tuesday 9th October, 2007

        Mike Lasseter

        M Offline
        M Offline
        manni_n
        wrote on last edited by
        #3

        its not working man... form3 is not becoming child of form1..

        M 1 Reply Last reply
        0
        • M manni_n

          its not working man... form3 is not becoming child of form1..

          M Offline
          M Offline
          mr_lasseter
          wrote on last edited by
          #4

          Yes it does work. The code I pasted should be run on form2. Paste you code for each form and I will tell you what you are doing wrong.

          Mike Lasseter

          M 1 Reply Last reply
          0
          • M mr_lasseter

            Yes it does work. The code I pasted should be run on form2. Paste you code for each form and I will tell you what you are doing wrong.

            Mike Lasseter

            M Offline
            M Offline
            manni_n
            wrote on last edited by
            #5

            i am using VS 2005. when i am writin this code in button click event of form2, form 3 gets open but not as a child of form1.. it opens as individual form...

            M 1 Reply Last reply
            0
            • M manni_n

              i am using VS 2005. when i am writin this code in button click event of form2, form 3 gets open but not as a child of form1.. it opens as individual form...

              M Offline
              M Offline
              mr_lasseter
              wrote on last edited by
              #6

              The code I posted works, post your code for each form.

              Mike Lasseter

              M 1 Reply Last reply
              0
              • M mr_lasseter

                The code I posted works, post your code for each form.

                Mike Lasseter

                M Offline
                M Offline
                manni_n
                wrote on last edited by
                #7

                form1 is mdiparent with ismdicontainer as true coding for form1 button_click event dim frm2 as new form2 frm2.show() now in button click event in form2 dim frm3 as form3 frm3.mdiparent=me.mdiparent frm3.show() this was your method.. the method which i am using is in form2 i code button_click() dim frm3 as new form3 frm3.mdiparent= form1 frm3.show() this one works but only when form1 is startup form. if form1 is any intermediate form and startup form is any other form then this method doesnt works.. any solution..?? thanks

                M 1 Reply Last reply
                0
                • M manni_n

                  form1 is mdiparent with ismdicontainer as true coding for form1 button_click event dim frm2 as new form2 frm2.show() now in button click event in form2 dim frm3 as form3 frm3.mdiparent=me.mdiparent frm3.show() this was your method.. the method which i am using is in form2 i code button_click() dim frm3 as new form3 frm3.mdiparent= form1 frm3.show() this one works but only when form1 is startup form. if form1 is any intermediate form and startup form is any other form then this method doesnt works.. any solution..?? thanks

                  M Offline
                  M Offline
                  mr_lasseter
                  wrote on last edited by
                  #8

                  You are right, I misread your post and thought Form2 was an MdiChild of Form1 as well. I don't understand why you would ever use the scenario in your post. Generally, with Mdi applications you don't create forms that are not MdiChildren or Dialog forms (dialog forms must be closed before you can do anything else in the application, like the MessageBox). The reason for this is all your forms are neatly contained in the main application instead of spread out across your machine. But you know what you are trying to do better than me, just hope I was able to offer something helpful.

                  Mike Lasseter

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups