CODE
Public Class frmMainForm
Private objPersonList As PersonList
Private objPersonalDetails As PersonalDetails
Private Sub btnShowList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowList.Click
objPersonList = New PersonList
If objPersonalDetails IsNot Nothing Then
pnlMain.Controls.Remove(objPersonalDetails)
objPersonalDetails = Nothing
End If
pnlMain.Controls.Add(objPersonList)
objPersonList.Dock = DockStyle.Fill
End Sub
Private Sub btnAddPerson_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddPerson.Click
objPersonalDetails = New PersonalDetails
If objPersonList IsNot Nothing Then
pnlMain.Controls.Remove(objPersonList)
objPersonList = Nothing
End If
pnlMain.Controls.Add(objPersonalDetails)
objPersonalDetails.Dock = DockStyle.Fill
End Sub
End Class
On the PersonalDetails form, I have several text boxes. The textbox for the address will disappear when I test the form. When I made the background of the textbox blue, I could see the blue box in a split second then disappear. It looks like it is covered by the panel background. I tried to delete the text box and recreated it, but the result is still the same. Any ideas?
Thank you very much.