Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form in panel and resizing

Status
Not open for further replies.

russgreen

Programmer
Dec 7, 2002
86
GB
Hi,

I'm using this code to add form to a panel in a main resizable form.
Code:
 Dim frm As Form

        Select Case e.Button.Text
            Case "Staff" : frm = New frmEmployees
                'Case "Details" : frm = New frmCompanyDetails


        End Select

        Me.pnlMain.Controls.Clear()

        frm.TopLevel = False
        frm.WindowState = FormWindowState.Maximized
        frm.Dock = DockStyle.Fill

        Me.pnlMain.Controls.Add(frm)
        frm.Show()

Works a treat. But how do I handle resizing the form that is in the panel when the panel is resized. I'd like to do this without removing the form and adding it again.

TIA

Russ
 
try setting the anchors
eg
frm.anchorstyle = anchorstyles.left + anchorstyles.right + anchorstyles.top + anchorstyles.bottom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top