Can one form contain another as a control?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here's what I'm going for.

I have an edit form to be used when adding new entries.

What I am envisioning for the search/edit process would be a form that would
have filtering text & combo boxes along the top, a TreeView control along the
left to list all entries that match the filter, then the same edit screen as
above in the balance of the form (I would remove the border and control box
in this case, I just don't want to duplicate stuff).

I could probably come close using an MDI, but I already have an MDI form
that "houses" the system, and a form can not be both an MDI parent & child.
Can I add a form to another form as a "control" on a panel, for example?
 
Try this:

'Forms – Adding Form to a Form
Dim myForm As New Form1
MyForm.TopLevel = False
Me.Controls.Add(myForm)
myForm.Location = New Point(10, 10)
myForm.Visible = True
 
Awesome. Thanks.

Interesting that

MyForm.TopLevel = False

TopLevel is not in intellisense.
 
Interesting that
MyForm.TopLevel = False

TopLevel is not in intellisense.

Make sure that you can see Advanced members. Go to Tools -> Options
-> Text Editor -> Basic and clear the checkbox next to Hide Advanced
Members

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top