Avatar of sydneyguy
sydneyguy
Flag 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

Visual Basic ClassicVisual Basic.NETVB Script

Avatar of undefined
Last Comment
sydneyguy

8/22/2022 - Mon
sydneyguy

ASKER
image shot of what i am trying to achieve
reportprint.png
sydneyguy

ASKER
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
sydneyguy

ASKER
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
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
joriszwaenepoel

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
sydneyguy

ASKER
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
joriszwaenepoel

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
sydneyguy

ASKER
thanks for the help have taken on board and making the aprop changes
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.