|
-
December 24th, 2008, 04:25 AM
#1
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?
-
December 24th, 2008, 08:26 AM
#2
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
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
0100 1101 0110 1001 0110 0011 0110 1000 0110 0001 0110 0101 0110 1100 0010 0000 0100 0101 0110 1100 0110 1100 0110 0101 0111 0010
-
January 2nd, 2009, 06:07 AM
#3
Re: Displaying an MDIChild form
HairyMonkeyMan
is right,that must solve your problem
-
January 8th, 2009, 03:33 AM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|