i open a child form from within a parent form

    Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
            Dim custmast As New CustomerMaster
            custmast.MdiParent = Me.MdiParent
            custmast.Show()
        End Sub

now the form customer master has values within a listview. when i doubleclick on a value within the listview i want this form to close and pass the value to a textbox within the parent form. what would the code be? I am relatively new to vb.

    Private Sub Listview_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Listview.DoubleClick
  If Not Listview.SelectedItems.Count = 0 Then
                        With LvList.SelectedItems(0)
ParentForm.Textbox1.Text = Listview.SelectedItems.Item(0).Text
 End With
                    End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.