The following code sample demonstrates passing information from one form to another form along with using assertion and being pro-active to ensure no runtime issues. I didn't match up your current code, wanted to give you a clear example that is easy to understand and allow anyone to try it out. Feel free to tweak as needed but the idea is to simply learn and adapt to your code.
Full project source code
1 is parent form, 2 is the child form where in form2 pressing a button passes the current month name to the list box in the calling form.
Main form
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles ShowChildForm.Click
Dim childForm As New Form2
AddHandler Form2.ListBoxSelectionChanged, AddressOf AddMonth
childForm.ShowDialog()
RemoveHandler Form2.ListBoxSelectionChanged, AddressOf AddMonth
End Sub
Private Sub AddMonth(monthName As String)
If MonthsListBox.FindStringExact(monthName, 0) = -1 Then
MonthsListBox.Items.Add(monthName)
MonthsListBox.SelectedIndex = MonthsListBox.Items.Count - 1
End If
End Sub
Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown
MonthsListBox.Sorted = True
End Sub
Private Sub GetCurrentMonthButton_Click(sender As Object, e As EventArgs) Handles GetCurrentMonthButton.Click
If MonthsListBox.SelectedIndex > -1 Then
MessageBox.Show($"{MonthsListBox.SelectedIndex} -> {MonthsListBox.Text}")
End If
End Sub
End Class
Imports System.Globalization
Public Class Form2
Public Delegate Sub OnListBoxSelectDelegate(month As String)
Public Shared Event ListBoxSelectionChanged As OnListBoxSelectDelegate
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
MonthsListBox.DisplayMember = "MonthName"
MonthsListBox.DataSource = Enumerable.Range(1, 12).
Select(Function(index)
Return New With {Key .MonthName =
DateTimeFormatInfo.CurrentInfo.GetMonthName(index)}
End Function).ToList()
End Sub
Private Sub SendToParentFormButton_Click(sender As Object, e As EventArgs) _
Handles SendToParentFormButton.Click
If MonthsListBox.SelectedIndex > -1 Then
RaiseEvent ListBoxSelectionChanged(MonthsListBox.Text)
End If
End Sub
End Class