Click here to Skip to main content
12,064,498 members (64,795 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB9.0 VB .NET
I'm trying to set up a Midi application. I've got a MID-Form and some other forms which should show up as children.

But Calling the show() method (after setting childform.mdiparent to the Mid-Form) does not result in the desired effect. They show modal/ as popup.

If I just instance a blank form, this works.

Is there any property to put attention to or something else that prevents a form from being shown as a child?

[Edited to remove MIDI tag!]
Posted 28-Nov-09 7:01am
Edited 15-May-12 5:58am
DaveyM6982.5K
v4
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I just created a windows forms project. Added an MDIForm, and 2 forms, dropped a button on the MDI surface and in the click event for the button did the following;
Dim form1 As New Form1
form1.Show()
 
Dim Form2 As New Form2
Form2.MdiParent = Me
Form2.Show()

And it worked as expected, Form1 appeared outwith the mdi and Form2 appeared in the mdi.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Hi,

I finally found the error...

I created an instance of Form2 (lets say _F2), but I did not set the instances (_F2) property MDIparent to Form1, but Form2's property (class itself). VB did not throw an exeption and it took me a while until I discovered the mistping.

However,
thanks a lot!

cheers
Gabriel
  Permalink  
Comments
losmac 15-May-12 11:00am
   
Please, mark this question as "solved".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160204.4 | Last Updated 15 May 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100