show form into splitcontainer.panel

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

Guest

Hello people, i need a favor from you, i need display a windows form into a
panel. How i do it?
 
Hi,

Declare Auto Function SetParent Lib "user32" (ByVal hWndChild As IntPtr,
ByVal nWndPArent As IntPtr) As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim frm As New Form2

SetParent(frm.Handle, Me.SplitContainer1.Panel2.Handle)

frm.Show()

End Sub



Ken
 
You can do it withough interop too:

Dim frm As New Form2

frm.TopLevel = False
frm.Parent = Me.SplitContainer1.Panel2
frm.Show
 
Andres Rojas said:
Hello people, i need a favor from you, i need display a windows form into
a
panel. How i do it?

Maybe it's better to use user controls ("Project" -> "Add user control...")
instead of forms. Otherwise I'd stick with the 'TopLevel = False' tip.
 
Back
Top