RE: Can one form contain another as a control?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Dennis (Dennis_at_discussions.microsoft.com)
Date: 01/16/05


Date: Sat, 15 Jan 2005 21:57:01 -0800

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

"EdB" wrote:

> 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?
>
>


Quantcast