I have a form with a text box, button and a public shared property. The button displays another form with a data grid view. When a row is clicked on in the data grid view it takes the value that was selected and assigns it to the public shared property of the original form, as well as closes the form
Private Sub dgvAllSku_CellContentDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvAllSku.CellContentDoubleClick
frmMain.Sku = dgvAllSku.Rows.Item(e.RowIndex).Cells(0).Value
Me.Close()
End Sub
Now what I want to have happen is, as this form closes I want the value (frmMain.Sku) to fill the text box on the original form. I was hoping the GotFocus event would be fired again when the data grid view form closes and I could use that event to assign the text box the value of the public property, but that got focus event isn't firing when the form closes.
Private Sub frmMain_Activated(sender As Object, e As EventArgs) Handles Me.GotFocus
txtSku.Text = frmMain.Sku
End Sub
How do I accomplish this?