alicecooper1203
New member
- Joined
- Feb 16, 2014
- Messages
- 3
- Programming Experience
- Beginner
Hi all I have a program that has two forms the first form has 2 buttons and a combobox on it and the second form has a text box
the first button on the first form loads an instance of the second form each time it is pressed (this bit works fine)
the combo and the second button on the first form is to select one of the instances of the second form created and put some text in the textbox on the selected second form. when I run it as I said previously the first button runs fine but the second throws the error:-An unhandled exception of type 'System.MissingMemberException' occurred in Microsoft.VisualBasic.dll
Additional information: Public member 'txt1' on type 'Form2' not found
Public
tester As New ArrayList
Public frmmessage As New Form2
Public formcount As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
frmmessage =
New Form2
frmmessage.Text = formcount
frmmessage.txt1.Text =
"hello"
tester.Add(frmmessage)
tester(formcount).show()
ComboBox1.Items.Add(formcount)
ComboBox1.SelectedIndex = 0
formcount += 1
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim x As Integer
x = ComboBox1.SelectedIndex
tester(x).txt1.Text =
"goodbye"
End Sub
sorry cant make it post properly but hopefully u get the gist any help appreciated
many thanks coop
the first button on the first form loads an instance of the second form each time it is pressed (this bit works fine)
the combo and the second button on the first form is to select one of the instances of the second form created and put some text in the textbox on the selected second form. when I run it as I said previously the first button runs fine but the second throws the error:-An unhandled exception of type 'System.MissingMemberException' occurred in Microsoft.VisualBasic.dll
Additional information: Public member 'txt1' on type 'Form2' not found
Public
tester As New ArrayList
Public frmmessage As New Form2
Public formcount As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
frmmessage =
New Form2
frmmessage.Text = formcount
frmmessage.txt1.Text =
"hello"
tester.Add(frmmessage)
tester(formcount).show()
ComboBox1.Items.Add(formcount)
ComboBox1.SelectedIndex = 0
formcount += 1
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim x As Integer
x = ComboBox1.SelectedIndex
tester(x).txt1.Text =
"goodbye"
End Sub
sorry cant make it post properly but hopefully u get the gist any help appreciated
many thanks coop
Last edited: