How to handl multiple forms from single form in c#.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neehakale
    New Member
    • Aug 2007
    • 46

    How to handl multiple forms from single form in c#.net

    Im new to C# and im doing a project that requires to integrate many forms in a single form. for eg, Form1 is my main form. when i clicked on a button or links in the main form the new form should open ....i any of u know how to do this pls tel me
  • shiponeye1
    New Member
    • Aug 2007
    • 8

    #2
    Hi, Its very simple like...

    on button or link event just add this code
    say you have 2 form

    frmMain, frmChild
    you want to call frmChild from frmMain

    code will be

    frmChild oChildForm=new frmChild;

    oChildForm.Show Dialog();


    it protect u from opening another from without close the oChildForm. if you want to open multiple form at a time use the following code.

    oChildForm.Show ();

    !!! SHIPON !!!

    Comment

    • dip_developer
      Recognized Expert Contributor
      • Aug 2006
      • 648

      #3
      Originally posted by neehakale
      Im new to C# and im doing a project that requires to integrate many forms in a single form. for eg, Form1 is my main form. when i clicked on a button or links in the main form the new form should open ....i any of u know how to do this pls tel me
      You can use a MDI form instead.......

      Read about MDI form here

      Comment

      • neehakale
        New Member
        • Aug 2007
        • 46

        #4
        Tnk u very much.......but b4 seeing to ur replies i have done that by 1st method......... ..Nw i have 1 new problem.....IS THERE ANY METHOD TO DIRECTLY DESIGN THESE FORMS LIKE WE DESIGN MAIN FORM WITH THE HELP OF TOOL BOX............ .

        Comment

        • shahjapan
          New Member
          • Apr 2007
          • 63

          #5
          I think as you are new to C#,
          Use design view. and also most of time, we dont need to do it using code.
          and you are not at this stage as u r newbie, to do it using code.
          still u want to try then see ur form.designer.c s for more information how you can achieve it without designing the form.

          Originally posted by neehakale
          Tnk u very much.......but b4 seeing to ur replies i have done that by 1st method......... ..Nw i have 1 new problem.....IS THERE ANY METHOD TO DIRECTLY DESIGN THESE FORMS LIKE WE DESIGN MAIN FORM WITH THE HELP OF TOOL BOX............ .

          Comment

          • neehakale
            New Member
            • Aug 2007
            • 46

            #6
            I got tha answer of above question also...tnku very much for help

            Comment

            Working...