Results 1 to 7 of 7

Thread: Form container

  1. #1

    Thread Starter
    Hyperactive Member vbud's Avatar
    Join Date
    Jan 2002
    Location
    Mru 20 17S, 57 33E Goal: Get out of the BOX Status: In The Shadows!!! Target Posts: 3,000,000,000
    Posts
    378

    Form container

    Hi all,

    I have to design a form such that, it will contain a list of buttons or toolbar on the left side. Each time the user clicks on one of the buttons, it will load the corresponding sub/child form on the right side of the main form. Note that Mdi shold not be used. Now what I need is to know if its possible to make other forms appear inside a classic form in VB.Net. If so then how, should I place the forms in a container control. All help appreciated. thanx.
    >!v!<
    Free your mind, stop thinking
    http://inspirone.blogspot.com

    Please rate this post if it helped you

  2. #2
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    Do you have to use forms?

    Can't you use Panel controls instead?
    This world is not my home. I'm just passing through.

  3. #3
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    I did something similar with a treeview on the left and a tab control that would load the appropriate tabs for the treeview item selected. Then when the user clicked on a tab, I would actually go and load the tab page content.

  4. #4
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651
    Hi

    Put two panels on your main form. The panel on left will hold your menup buttons (pnlButton) and the one on the right will act as container for your forms (pnlForm). When you click on a button instantiate the corresponding form and change its container property to that of the pnlForm panel. Your forms should be window less.
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost too ...

  5. #5

    Thread Starter
    Hyperactive Member vbud's Avatar
    Join Date
    Jan 2002
    Location
    Mru 20 17S, 57 33E Goal: Get out of the BOX Status: In The Shadows!!! Target Posts: 3,000,000,000
    Posts
    378

    Thumbs up

    Thanx Mr.No, but isn't the Container property of a form Read Only?
    Last edited by vbud; May 29th, 2003 at 12:22 AM.
    >!v!<
    Free your mind, stop thinking
    http://inspirone.blogspot.com

    Please rate this post if it helped you

  6. #6
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651
    You're right, didn't know that. I think you should look for a property or method in the Panel control or any other container control that allows you to drop controls on them so that you could add your instantiated form into it.
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost too ...

  7. #7
    Addicted Member
    Join Date
    Nov 2000
    Location
    San Diego - California
    Posts
    251
    At last...

    private void button1_Click(object sender, System.EventArgs e)
    {
    Form frm = new frm_Tasks(); //Create an instant of the form
    frm.TopLevel = false;
    frm.Parent = pnl_main;
    frm.Show(); //Display the form
    }
    Control Data Systems
    www.members.shaw.ca/cdsystems

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