Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 9th, 2003, 12:10 PM
Registered User
 
Join Date: Nov 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Setting MDI Parent / Child

Hi All,

I have an MDI Parent form (frmMDI) that calls a child form (frmChild1). frmChild1 calls another child form (frmChild2). in the form load event for frmChild2, i close frmChild1. The problem is, that when frmChild2 opens, it is not a child form of frmMDI and i am having problems trying set frmChild2 to be a child a frmMDI...here is some code...

'CONSTRUCTOR FOR frmChild2
'DOESN'T PRODUCE AN EXCEPTION, BUT WON'T WORK EITHER
Public Sub New(parentForm As Form)
   MyClass.New()
   Me.MdiParent = parentForm
End Sub

'THIS CODE CLOSES frmChild1
Private Sub frmChild2_Form_Load()
   Try
      frmChild1.ActiveForm.ActiveMdiChild.Close()
   Catch ex As Exception
      MsgBox(ex.Message)
   End Try
end sub



 
Old December 9th, 2003, 12:23 PM
Registered User
 
Join Date: Nov 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi All,

Ok i got it figured out...if any one is interested, the i had to set the mdiParent in the Sub in frmChild1 that calls frmChild2...here's the working code...

    Private Sub Show_frmChild2()
        Dim objForm As New frmChild2
        objForm.MdiParent = ParentForm
        objForm.Show()
    End Sub

 
Old March 27th, 2008, 05:05 AM
Authorized User
 
Join Date: May 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shaileshk Send a message via Yahoo to shaileshk
Default

Hello Friends,

I found the solution on the above error.

 http://codegroups.com/blog/index.php...l-studio-2005/



Let me know if have still error.

Regards,
Shailesh

shailesh kavathiya





Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying MDI Child Form Menus with MDI Parent ashu_from_india Pro VB 6 3 June 10th, 2008 11:01 PM
Controlling MDI child form from MDI parent panel LuxCoder Pro Visual Basic 2005 1 May 25th, 2007 12:20 PM
Controlling MDI child form from MDI parent panel LuxCoder VB.NET 2002/2003 Basics 7 April 11th, 2007 02:38 PM
Controlling MDI child form from MDI parent panel LuxCoder VB How-To 1 April 9th, 2007 03:25 PM
Controlling MDI child form from MDI parent panel LuxCoder Visual Basic 2005 Basics 2 April 9th, 2007 03:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.