I have managed to pass a string as follows:
In Child form (frmTime):
In Parent form
For passing a Collection I have in the Child form
Dim colWorkCode As New AutoCompleteStringCollection() 'Module level
I populate the collection in the Child form
I do not know how to pass the collection back to the parent form.
Any help would be appreciated.
John
In Child form (frmTime):
VB.NET:
Dim strmTime As String 'Module variable
Public Function fungResultTime() As String
Return strmTime
End Function
Public Sub New(ByVal strTime)
MyBase.New()
InitializeComponent()
strmTime = strTime
End Sub
In Parent form
VB.NET:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim frm = New frmTime(TextBox1.Text)
frm.ShowDialog()
TextBox1.Text = frm.fungResultTime
End Sub
For passing a Collection I have in the Child form
Dim colWorkCode As New AutoCompleteStringCollection() 'Module level
I populate the collection in the Child form
VB.NET:
colWorkCode.Clear()
For i As Integer = 0 To dgv.Rows.Count - 1
If dgv.Rows(i).Cells("bitSelection").Value = True Then
colWorkCode.Add(dgv.Rows(i).Cells("nvcWorkCode").Value)
End If
Next
I do not know how to pass the collection back to the parent form.
Any help would be appreciated.
John