Results 1 to 3 of 3

Thread: [RESOLVED] Help with MDI

  1. #1

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Resolved [RESOLVED] Help with MDI

    Guys help please..I have a MDI form and in the parent form I have 2 buttons, Button1 and Button2, when I click the Button1 Child Form1 will be shown and button1 will be disabled and the same with Button2, when I click Button 2 Child Form2 will be shown and Button2 will be disbaled but how will I enable Button1 and close Form1 when the user click on Button2 or vice versa so as only One(1) child form is open/shown.Any help please. Thanks!
    Last edited by daimous; Jun 19th, 2007 at 09:50 PM.

  2. #2
    Hyperactive Member fret's Avatar
    Join Date
    Sep 2004
    Posts
    472

    Lightbulb Re: Help with MDI

    You can make a public properties in your MDI Form for your buttons (1 & 2) in order to manipulate the disable/enable property of it, so when you load your form1 it should be like this or something:

    Code:
            Frmparent parnt;
            private void Form1_Load(object sender, EventArgs e)
            {
                parnt = (Frmparent)MdiParent;
                parnt.Btn1.Enabled = false;
            }
    so when you closed your form1 in the closed event you can easily set "parnt.Btn1.Enabled = true;

    hope that helps.

  3. #3

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: Help with MDI

    Thanks a lot Fret.

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