creating a separate window in c#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 044879
    New Member
    • Feb 2007
    • 7

    creating a separate window in c#

    Hello. What I am trying to do is simple. I don't want to create a window inside a form, but a window that acts independently outside the form. so for example, let's say I am doing a program that displays statistics about a person, so, when the user clicks a button, a separate window appears that displays the information.

    thank you.
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Originally posted by 044879
    Hello. What I am trying to do is simple. I don't want to create a window inside a form, but a window that acts independently outside the form. so for example, let's say I am doing a program that displays statistics about a person, so, when the user clicks a button, a separate window appears that displays the information.

    thank you.
    Create another form.

    Comment

    • 044879
      New Member
      • Feb 2007
      • 7

      #3
      Thanks for the reply. I did this previously, ie

      Form chForm = new Form();
      chForm.MdiParen t = this;

      chForm.Left = 100;
      chForm.Show();

      But, the window appears within the form, not outside it.

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        Originally posted by 044879
        Thanks for the reply. I did this previously, ie

        Form chForm = new Form();
        chForm.MdiParen t = this;

        chForm.Left = 100;
        chForm.Show();

        But, the window appears within the form, not outside it.
        The reason your child form appeared inside the original form is because you set the child form's parent!

        Code:
        chForm.MdiParent = this; //SET THE PARENT FORM TO this MDI CONTAINER

        Comment

        • NSRao
          New Member
          • Jan 2007
          • 11

          #5
          use new form

          Comment

          • nmsreddi
            Contributor
            • Jul 2006
            • 366

            #6
            Hello

            Your question sounds typical what a window you mean and a form .

            if you want to have your main form existing and show some the details in some other new windows form dont make it as a child for the main form just use

            form2().showmet hod you can defnately get the new window separately and you can close that new one too

            Hope may be clear

            Good luck

            Comment

            Working...