Link to home
Create AccountLog in
Avatar of sydneyguy
sydneyguyFlag for Australia

asked on

vs2005 VB adding a sub form to another main form

I am trying to add a child form to a parent main form.
EG:  form  ..... parent form will have
                            Child1, child2  placed on it
so when you open the parent form you will get Child1 and Child2 accessable on the parent form

In access you would open the parent form and then just drop the child1 form and the child2 form onto the main form and its ready to go

Avatar of sydneyguy
Flag of Australia image


image shot of what i am trying to achieve
I have posted a couple of other questions if you woudl like to have a look, same projects  jsut different aspects that i am trying to work through with some oeve lap
it looks like this will not be a workable solution as the forms in vs2005 only go as large as the screen and seem not to alow scrolling as did access, so will have to look at the report and printing ways of presenting instead of the form presentation
any ideas

This is not the preferred way of working with forms in VB.NET.
However, you can create usercontrols instead of sub-forms, and put these on your main-form.

Or, if you really want to keep working with "subforms", you can load a form into a panel on another form with code like this:

        Panel1.AutoScroll = True

        Dim f2 As New Form2
        f2.TopLevel = False
        f2.Parent = Me.Panel1
        f2.FormBorderStyle = Windows.Forms.FormBorderStyle.None

The panel gets scrollbars if the subform doesn't fit.

Hope this helps,

so what is the best method of using sub forms when you have 100 - 200 forms that need to be created, individual forms it at least tab form components
Avatar of joriszwaenepoel
Flag of Belgium image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
thanks for the help have taken on board and making the aprop changes