Results 1 to 4 of 4

Thread: [RESOLVED] How to Change what a Childform has in it.

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    1

    Resolved [RESOLVED] How to Change what a Childform has in it.

    Hi im new to c# and i cant figure out how to change what appears in the new childform window that appears when u click the new button. th coding i have so far is

    private void ShowNewForm(object sender, EventArgs e)
    {
    // Create a new instance of the child form.
    Form childForm = new Form();
    // Make it a child of this MDI form before showing it.
    childForm.MdiParent = this;
    childForm.Text = "Window " + childFormNumber++;
    childForm.Show();
    }

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to Change what a Childform has in it.

    Moved to C#

  3. #3
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: How to Change what a Childform has in it.

    put:
    Code:
    this.IsMdiContainer=true;
    in your Form_Load event handler
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  4. #4
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843

    Re: How to Change what a Childform has in it.

    Create a new form, say Form2.
    build it up like you want it to look,
    then instead of
    Form childForm = new Form();
    yours would read
    Form childForm = new Form2();
    might want to do something like
    childForm.top=0;
    childForm.left=0;
    Merry Christmas

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