Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 9th, 2003, 12:10 PM
Registered User
 
Join Date: Nov 2003
Location: , , .
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



Reply With Quote
  #2 (permalink)  
Old December 9th, 2003, 12:23 PM
Registered User
 
Join Date: Nov 2003
Location: , , .
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

Reply With Quote
  #3 (permalink)  
Old March 27th, 2008, 05:05 AM
Authorized User
 
Join Date: May 2005
Location: rajkot, gujarat, India.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:00 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.