error on using arrray...(not a member of the form) ??
-
i was trying to make change on the text from the other form by using the array in a loop but the error about which it's not a member of the form1??? y?? i check properly the label was there and with correct name.... C:\Documents and Settings\acer\My Documents\Visual Studio Projects\SnL1\SnL1\PlayerSelect.vb(492): 'com' is not a member of 'SnL1.Form1'. here my coding: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim com As Label() = ControlArrayUtils.getControlArray(Me, "com") Dim x As Integer Dim game as new form1 Game.NumPlayer.Text = ComboBox1.Text Game.PTurn1.Text = TextBox1.Text Game.PTurn2.Text = TextBox2.Text Game.PTurn3.Text = TextBox3.Text Game.PTurn4.Text = TextBox4.Text For x = 1 To Val(ComboBox1.Text) Game.com(x).Text = y Next Game.Show() Me.Hide() End Sub
-
i was trying to make change on the text from the other form by using the array in a loop but the error about which it's not a member of the form1??? y?? i check properly the label was there and with correct name.... C:\Documents and Settings\acer\My Documents\Visual Studio Projects\SnL1\SnL1\PlayerSelect.vb(492): 'com' is not a member of 'SnL1.Form1'. here my coding: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim com As Label() = ControlArrayUtils.getControlArray(Me, "com") Dim x As Integer Dim game as new form1 Game.NumPlayer.Text = ComboBox1.Text Game.PTurn1.Text = TextBox1.Text Game.PTurn2.Text = TextBox2.Text Game.PTurn3.Text = TextBox3.Text Game.PTurn4.Text = TextBox4.Text For x = 1 To Val(ComboBox1.Text) Game.com(x).Text = y Next Game.Show() Me.Hide() End Sub
-
actually i found a lot of tis similar problem even i change the name it still hapen especially when refer to other form and not itself...
-
i was trying to make change on the text from the other form by using the array in a loop but the error about which it's not a member of the form1??? y?? i check properly the label was there and with correct name.... C:\Documents and Settings\acer\My Documents\Visual Studio Projects\SnL1\SnL1\PlayerSelect.vb(492): 'com' is not a member of 'SnL1.Form1'. here my coding: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim com As Label() = ControlArrayUtils.getControlArray(Me, "com") Dim x As Integer Dim game as new form1 Game.NumPlayer.Text = ComboBox1.Text Game.PTurn1.Text = TextBox1.Text Game.PTurn2.Text = TextBox2.Text Game.PTurn3.Text = TextBox3.Text Game.PTurn4.Text = TextBox4.Text For x = 1 To Val(ComboBox1.Text) Game.com(x).Text = y Next Game.Show() Me.Hide() End Sub
rompnet wrote:
i was trying to make change on the text from the other form
You should NOT be doing this. In proper OOP and UI design, one form should not be making any modifications to the controls of another. You should be exposing the data on your second form as Public Properties, so any other form that creates this form can retrieve any data it needs and can update it's own controls with that data. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
i was trying to make change on the text from the other form by using the array in a loop but the error about which it's not a member of the form1??? y?? i check properly the label was there and with correct name.... C:\Documents and Settings\acer\My Documents\Visual Studio Projects\SnL1\SnL1\PlayerSelect.vb(492): 'com' is not a member of 'SnL1.Form1'. here my coding: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim com As Label() = ControlArrayUtils.getControlArray(Me, "com") Dim x As Integer Dim game as new form1 Game.NumPlayer.Text = ComboBox1.Text Game.PTurn1.Text = TextBox1.Text Game.PTurn2.Text = TextBox2.Text Game.PTurn3.Text = TextBox3.Text Game.PTurn4.Text = TextBox4.Text For x = 1 To Val(ComboBox1.Text) Game.com(x).Text = y Next Game.Show() Me.Hide() End Sub
To add to Dave's reply: You might like to look at this article which shows you how to do what you want: Passing Values Between Forms[^] ColinMackay.net Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?