EStallworth
Well-known member
I have an multiform application that lists the open forms (by name[text]) in a listbox on the main form. As a new form is opened a string representing that form is sent to the listbox. What I am trying to do is set it so that when the selected index changes, between form names, that particular form is brought into focus. Can anyone help?¿ I've looked through some other threads and haven't quite found what I am looking for. At first I used:
But of course this gives me a new instance and not the current form being used.
VB.NET:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
If listbox1.selectedindex.Equals("Return History") Then
Dim history As New ReturnHistory(ListBox1, MenuItem4, pw)
history.Show()
End If
End Sub
But of course this gives me a new instance and not the current form being used.