Hi…. folks/experts
I have created a mdiParent form and several form which I have set as mdiChild. I have a menu bar on the mdiParent and when I click any of the buttons, I have written the following piece of code:
this works fine and its is displayed within the bounds of the the mdiParent.
Now once I have displayed the search form I list the search results using a list viewer. On selecting the particular record I am loading the frmDetails where the entire details are displayed.
However I would like to load frmDetails as a mdiChild so that it falls within the bounds of the mdiParent but the moment I set it the program just flashes the frmDetails once on the screen and then disappears. The code is as follows:
Please suggest as to how I could tackle this issue.
I have created a mdiParent form and several form which I have set as mdiChild. I have a menu bar on the mdiParent and when I click any of the buttons, I have written the following piece of code:
VB.NET:
Dim objSearch As frmSearch
objSearch = New frmSearch
objSearch.MdiParent = Me
objSearch.Show()
this works fine and its is displayed within the bounds of the the mdiParent.
Now once I have displayed the search form I list the search results using a list viewer. On selecting the particular record I am loading the frmDetails where the entire details are displayed.
However I would like to load frmDetails as a mdiChild so that it falls within the bounds of the mdiParent but the moment I set it the program just flashes the frmDetails once on the screen and then disappears. The code is as follows:
VB.NET:
Private Sub lsvSearch_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles lsvSearch.SelectedIndexChanged
Me.close() ‘ to close the search form
frmDetails.mdiParent = Me ‘ This causes the form to disappear
frmDetails.Show()
Dim sP As New ListView.SelectedListViewItemCollection(lsvSearch)
Dim vSlNo As Integer = sP.Item(0).SubItems.Item(0).Text
frmDetails.loadDetails(vSlNo)
End Sub
Last edited by a moderator: