Form within a form within a form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elmbrook
    New Member
    • Feb 2010
    • 15

    Form within a form within a form

    Here is my problem.

    I have a MainForm which is the parent.
    I have a toolbar form which is the child.

    ToolBarForm mytoolbarform = new ToolBarForm();
    mytoolbarform.M diParent = this;
    mytoolbarform.S how();

    I now want to call a third form from the Toolbar form which is a child of the MainForm.

    How do I do that?

    Thanks
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Create custom controller events on your toolbox that your mainform can listen to.
    Then in the eventhandler it can decide based on your arguments what to do. (Such as open up another form)

    Comment

    • elmbrook
      New Member
      • Feb 2010
      • 15

      #3
      Surely there is an easier answer than this? Should it not be a setting that says that this the first form is the parent form and the rest are child forms?

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Well yes, set the Parent object on your forms?

        Comment

        • elmbrook
          New Member
          • Feb 2010
          • 15

          #5
          myform.MdiParen t = this.MdiParent;

          Comment

          Working...