Results 1 to 4 of 4

Thread: Mdi Parent Problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Posts
    29

    Mdi Parent Problem

    Hi.

    im new to c# so pls bear with me and teach me.....

    i have created an MDI app, so i have three forms. frmMain , frmChild1 and frmChild2.

    in frmMain i have a button which will call frmChild2..

    button click event
    {
    frmChild2 c2 = new frmChild2();
    this.MdiParent();
    c2.Show();
    }

    and in frmChild2 i have a button callin frmChild3(this is also a child of frmMain)

    button click event
    {
    frmChild3 c3 = new frmChild3();
    /* how do i assign frmMain as the parent form?... */
    c3.Show();
    }

    i also have another problem when i click the button twice, two identical forms pop up...how do i check to see if the form is already open, just direct the user to it and if its closed then open one?...
    Arvinder Gill

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    As far as I know , in a MDI Application , there is only one MDI Parent that contains all the child forms .

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Posts
    29

    got it!

    yes pirate your right.

    anyways i got it...

    button click event
    {
    frm3 m = new frm3;
    frm3.MdiParent = this.MdiParent; // assigns the parent of frm2 as the parent of frm3
    frm3.Show();
    }


    if u dont do this...and u have many many forms which do different processes...try it...then look at your taskbar....each form has got a tab on the taskbar...
    Arvinder Gill

  4. #4
    Member
    Join Date
    Jun 2006
    Location
    Heaven
    Posts
    39

    Thumbs up Re: Mdi Parent Problem

    thanks asgil this was also my problem u have solved it.

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