Results 1 to 6 of 6

Thread: form inside a pannel

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    2

    Unhappy form inside a pannel

    Im trying to make an "administrative console style" application using
    vb.net (an application with a visual layout as usual mmc console applications). I'm
    using a main form with a SplitContainer. In the left SplitterPanel I have
    a TreeView control, and my idea is to open "subforms" in the right side
    SplitterPanel. This is easy to do with code like:

    Dim frm As Form
    frm = New subform
    frm.TopLevel = False
    Me.SplitterPanel1.Panel2.Controls.Add(frm)
    frm.Show()

    This works. The problem is when need to resize the main form. The
    "subform" remains in the some original size. I tried to change the frm.height,frm.width, frm.size, but this properties seem to be readonly.
    Can someone tell me howto force the subform to resize ? Is there any
    better way to make this "administrative console like" type of applications?
    Thank you

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,443

    Re: form inside a pannel

    What sort of forms are you putting in the panel? Are they of your own creation? If so I think you'd be better off with UserControls rather than forms.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    2

    Re: form inside a pannel

    I'm using standard forms with standard controls, like datagridviews... Do you mean use always the main form, and create the controls on that main form?

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,443

    Re: form inside a pannel

    Instead of designing forms and placing instances of them in your splitter panel you should desing UserControls. A UserControl is basically like a Panel that you design ahead of time and then use as a single unit when and where you want. Generally you would declare all the controls it contains as private and then only expose the properties, methods and events you want as public members of the UserControl. Designing a UserControl is just like designing a form. You can then create instances of your UserControl at design time or at run time. When you add them to a container you can set their Dock or Anchor property to have them resize with that container.

  5. #5
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: form inside a pannel

    What about a MDIForm with Child Forms?

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,383

    Re: form inside a pannel


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