Dim objControl As Control
Dim bFinished As Boolean = False
While Not bFinished
bFinished = True
For Each objControl In Me.Controls
Debug.WriteLine(objControl.Name)
If Not objControl Is Me.Panel1 And Not objControl Is
Me.Button2 Then
Panel1.Controls.Add(objControl)
bFinished = False
Exit For
End If
Next
What exactly do you want to do? Do you want to add the form to the
panel as a child control?
\\\
Dim f As New Form2()
f.TopLevel = False
Me.Panel1.Controls.Add(f)
f.Show()
///
Notice that this may cause focus problems, creating a usercontrol is the
preferred way.
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.