MDI form...
-
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
-
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
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
-
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
-
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
-
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
-
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...
The code I posted works, post your code for each form.
Mike Lasseter
-
The code I posted works, post your code for each form.
Mike Lasseter
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 form2dim frm3 as form3 frm3.mdiparent=me.mdiparent frm3.show()
this was your method.. the method which i am using is in form2 i codebutton_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 -
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 form2dim frm3 as form3 frm3.mdiparent=me.mdiparent frm3.show()
this was your method.. the method which i am using is in form2 i codebutton_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..?? thanksYou 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