CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2002
    Location
    Toronto
    Posts
    167

    showing a mdiChild form

    OK I am lost in my attempt to upgrade to .NET

    In visual basic 6.0 I would type

    form2.show

    and when I would run the app. it would show form1 as my mdi form and open form2 as the child form ... now I don't have a clue what to do to get form2 to appear on the screen as a child form of form1.

    Hopefully this is a simple upgrade for me to learn

    Thanks to anyone taking the time to help out.

    Jym (day one of learning Visual Basic .NET)

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

  3. #3
    Join Date
    Jul 2001
    Location
    Romania
    Posts
    52
    form1.IsMdiContainer= true;

    Form2Class newfrm2 = Form2Class.CreateInstance(parameters..);
    newfrm2.MdiParent = this;
    newfrm2.Show();

    //where Form2Class - is the form 2 class name

    //and this call is made from form1 body
    It is the weak who are cruel,
    only the strong can be truly gentle!
    Szilard

  4. #4
    Join Date
    Jul 2002
    Location
    .NET 2.0/.NET 3.0/.NET 3.5 VS2005/VS2008
    Posts
    284
    I guess you need this one for VB.NET:

    Code:
    public sub mySub()
      
      dim frm as new Form2
      
      frm.mdiParent = me
      frm.Show()
    
    end sub
    WM.

    What about weapons of mass construction?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured