show form into splitcontainer.panel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andres Rojas

    #1

    show form into splitcontainer.panel

    Hello people, i need a favor from you, i need display a windows form into a
    panel. How i do it?
  • Ken Tucker [MVP]

    #2
    Re: show form into splitcontainer. panel

    Hi,

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

    Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
    System.EventArg s) Handles MyBase.Load

    Dim frm As New Form2

    SetParent(frm.H andle, Me.SplitContain er1.Panel2.Hand le)

    frm.Show()

    End Sub



    Ken

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

    "Andres Rojas" <Andres Rojas@discussio ns.microsoft.co m> wrote in message
    news:EE56AE5A-D7B4-4698-9F3D-31BEEB55C1BC@mi crosoft.com...[color=blue]
    > Hello people, i need a favor from you, i need display a windows form into
    > a
    > panel. How i do it?[/color]


    Comment

    • Chris Dunaway

      #3
      Re: show form into splitcontainer. panel

      You can do it withough interop too:

      Dim frm As New Form2

      frm.TopLevel = False
      frm.Parent = Me.SplitContain er1.Panel2
      frm.Show

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: show form into splitcontainer. panel

        "Andres Rojas" <Andres Rojas@discussio ns.microsoft.co m> schrieb:[color=blue]
        > Hello people, i need a favor from you, i need display a windows form into
        > a
        > panel. How i do it?[/color]

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

        Comment

        • Andres Rojas

          #5
          Re: show form into splitcontainer. panel

          Thank for you collaboration.. .

          "Chris Dunaway" wrote:
          [color=blue]
          > You can do it withough interop too:
          >
          > Dim frm As New Form2
          >
          > frm.TopLevel = False
          > frm.Parent = Me.SplitContain er1.Panel2
          > frm.Show
          >
          >[/color]

          Comment

          Working...