Home All Groups Group Topic Archive Search About

show form into splitcontainer.panel

Author
23 Apr 2006 11:01 PM
Andres Rojas
Hello people, i need a favor from you, i need display a windows form into a
panel. How i do it?

Author
24 Apr 2006 11:20 AM
Ken Tucker [MVP]
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

-------------------

Show quoteHide quote
"Andres Rojas" <Andres Ro***@discussions.microsoft.com> wrote in message
news:EE56AE5A-D7B4-4698-9F3D-31BEEB55C1BC@microsoft.com...
> Hello people, i need a favor from you, i need display a windows form into
> a
> panel. How i do it?
Author
24 Apr 2006 1:18 PM
Chris Dunaway
You can do it withough interop too:

Dim frm As New Form2

frm.TopLevel = False
frm.Parent = Me.SplitContainer1.Panel2
frm.Show
Author
24 Apr 2006 9:12 PM
Andres Rojas
Thank for you collaboration...

Show quoteHide quote
"Chris Dunaway" wrote:

> You can do it withough interop too:
>
> Dim frm As New Form2
>
> frm.TopLevel = False
> frm.Parent = Me.SplitContainer1.Panel2
> frm.Show
>
>
Author
24 Apr 2006 6:00 PM
Herfried K. Wagner [MVP]
"Andres Rojas" <Andres Ro***@discussions.microsoft.com> schrieb:
> 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.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>