Displaying an MDIChild form
Hi all,
I am developing a small application with VB 2005.
The application uses a 'main' MDI form (frmMain) within which I want 4 MDI children forms are to be displayed. The user clicks 'New Registration' menu and the first form displays on the parent form (this is happening, fine), after completing this form, the user then clicks the 'Next' button to open the 2nd form (*this isn't happening, problem!).
My code to open the 2nd form looks like:
....btnNext_Click(...)...
Dim SecondForm as New frmSecond
Me.Hide/Me.Close 'I tried both
SecondForm.MDIParent = frmMain
SecondForm.Show()
End Sub
The current form closes or hides but the SecondForm does not appear. What could be the problem here?
Re: Displaying an MDIChild form
I don't think the reference to frmMain is in scope. Try it like this:
Code:
SecondForm.MDIParent = Me.MDIParent
Re: Displaying an MDIChild form
HairyMonkeyMan
is right,that must solve your problem
Re: Displaying an MDIChild form
Thanks guys. I was away and only got your replies today. I am going to try that and see if it works.
Actually, When the application uses a Login form as its start-up form that is when it gives problems displaying the other forms on the main (MDI Parent). When I use the main form as the start-up form all other forms are displayed with no problem.