I'm learning vb.net and have a problem. Short version of code.
I have structure like this:
public class form234
public array1() as string
public sub button1
Dim i As Integer
Dim array1(Len(text)) As String
For i = 1 To 3
array1(i) = "x"
TextBox2.Text = TextBox2.Text & array1(i) & " "
Next
When I put a msgbox here I get the content of my array
......
public sub button2
When I put a msgbox here I get error and array1 is "nothing"
...........
Why? How can I use my array value of sub button1 in sub button 2 as well?
Sub button1you have declared another array named "array1". It is not the same variable as the "array1" which is declared in the class. Please google for "vb.net variable scope" to learn more.