URGENT - Form Inside Panel, Problems resizing content correctly
Posted on 2006-04-19
Rather than using MDI I've opted to load forms inside of a panel for presentation purposes. My program is nearly complete, however I'm having issues when my form gets resized. My main form "frmPropertyTracker" has a panel on it called "pnlMainContent" and then within that panel I am displaying the new forms based upon the users selection. I used the following code that I found on EE and it has worked great except when I resize frmPropertyTracker the form displayed inside the panel stays maximized and does not resize the content accordingly. Ideally I would like it resize based on the size of the panel... if anyone can help I would apprecaite it!!
Private Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As Integer, ByVal hWndNewParent As Integer) As Integer
Private Sub btnLeaseSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLeaseSearch.Click
Dim frmPropertyTrackerLeases As New frmPropertyTrackerLeases
frmPropertyTrackerLeases.WindowState = FormWindowState.Maximized
The other issue I'm having with this code is that I would like to know how to close down other open forms before I run the code above so that I don't have 500 forms floating around in memory. Thanks in advance to anyone that can help...