Link to home
Start Free TrialLog 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
sydneyguy
Flag of Australia image

ASKER

image shot of what i am trying to achieve
reportprint.png
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
Hi,

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
        f2.Show()

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

Hope this helps,

Joris
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
ASKER CERTIFIED SOLUTION
Avatar of joriszwaenepoel
joriszwaenepoel
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks for the help have taken on board and making the aprop changes