sgfreestyler
Member
- Joined
- Aug 6, 2005
- Messages
- 6
- Programming Experience
- 1-3
======================================================
Dim FormTwo As New Form2
Public Shared tx As TextBox
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
tx = TextBox4
FormTwo.ListBox1.Items.Add(tx.Text)
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
FormTwo.Show()
End Sub
=====================================================
from the code, u can see that i have add the text from textbox4 to form2's listbox. this part is fine. But the problem i am facing is after i close my form2, i cannot open again .. it say "Cannot access a disposed object named "Form2". how do i correct this. i wan my form2 to be able to close and open freely with all the text i have added in the listbox still remain there.
can any1 help ..
tks
Dim FormTwo As New Form2
Public Shared tx As TextBox
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
tx = TextBox4
FormTwo.ListBox1.Items.Add(tx.Text)
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
FormTwo.Show()
End Sub
=====================================================
from the code, u can see that i have add the text from textbox4 to form2's listbox. this part is fine. But the problem i am facing is after i close my form2, i cannot open again .. it say "Cannot access a disposed object named "Form2". how do i correct this. i wan my form2 to be able to close and open freely with all the text i have added in the listbox still remain there.
can any1 help ..
tks