Form contents in a panel?

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

I've seen someone on here talking about this in the past about doing this...
but how can you load teh contents of a form into a panel?
 
Hi,

Dim frm As New Form2

frm.TopLevel = False

frm.Parent = Panel1

frm.Show()



Ken
 
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

End While
 
Hi Brian,

An alternative answer because your question can have more answers in my
idea.

Drag first a panel on your screen and than drag your control in that.

I hope this helps,

Cor
 
* "Brian Henry said:
I've seen someone on here talking about this in the past about doing this...
but how can you load teh contents of a form into a panel?

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.
 
Back
Top