W
waszer
Guest
In my main form I have the following code to call up another form;
Private Sub mnuPerennials_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPerennials.Click
Dim PerennialsForm As New frmPerennials()
PerennialsForm.ShowDialog()
End Sub
in the PerennialsForm is the following code
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim name As String = "warren"
Dim frmMain As New frmMain()
If chk1.Checked = True Then
frmMain.lstDisplay.Items.Add(name)
End If
Me.Close()
frmMain.Show()
End Sub
What I am trying to do is send a string back into the list box in the main form. With this code after the PerennialsForm closes, a new Main form opens, so now I have 2 main forms, but one of them has the String "Warren" in the list box. I have tried Me.Refresh() in the main form before the mnuPerennials_Click event ends (I take out the frmMain.Show()) thinking that all I need to do is refresh the main form, but the string is not there.
Private Sub mnuPerennials_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPerennials.Click
Dim PerennialsForm As New frmPerennials()
PerennialsForm.ShowDialog()
End Sub
in the PerennialsForm is the following code
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim name As String = "warren"
Dim frmMain As New frmMain()
If chk1.Checked = True Then
frmMain.lstDisplay.Items.Add(name)
End If
Me.Close()
frmMain.Show()
End Sub
What I am trying to do is send a string back into the list box in the main form. With this code after the PerennialsForm closes, a new Main form opens, so now I have 2 main forms, but one of them has the String "Warren" in the list box. I have tried Me.Refresh() in the main form before the mnuPerennials_Click event ends (I take out the frmMain.Show()) thinking that all I need to do is refresh the main form, but the string is not there.