im just learning loops and arrays, and i have a couple of questions.
i have a array set up, and i need the array to be global, but i can only get vb to accept it in a button, if anyone can help out thier. in addition, after the loop is completed, i am trying to pull a value from the array and display it but am getting an error.
the code is as follows:
Code:
Public Class Form1
    Friend staten As String
    Friend statea As String
    Dim statec(1, 54)
 
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        Me.Close()

    End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        statename.Clear()
        stateabbr.Clear()

    End Sub

    
    Public Sub findabbr_Click(sender As System.Object, e As System.EventArgs) Handles findabbr.Click
        staten = statename.Text

        Dim i As Integer
        Dim statec(,) As String = {{"alabama", "al"}, {"alaska", "ak"}, {"american samoa", "as"},
                                   {"arizona", "az"}, {"arkansas", "ar"}, {"california", "ca"},
                                   {"colorado", "co"}, {"connecticutt", "ct"}, {"delaware", "de"},
                                   {"washington d.c.", "dc"}, {"florida", "fl"}, {"georgia", "ga"},
                                   {"guam", "gu"}, {"hawaii", "hi"}, {"idaho", "id"}, {"illinois", "il"},
                                   {"indiana", "in"}, {"iowa", "ia"}, {"kansas", "ks"}, {"kentucky", "ky"},
                                   {"louisana", "la"}, {"maine", "me"}, {"maryland", "md"}, {"massachussets", "ma"},
                                   {"michigan", "mi"}, {"minnesota", "mn"}, {"missisippi", "ms"}, {"missouri", "mo"},
                                   {"montana", "mt"}, {"nebraska", "ne"}, {"nevada", "nv"}, {"new hampshire", "nh"},
                                   {"new jersey", "nj"}, {"new mexico", "nm"}, {"new york", "ny"}, {"north carolina", "nc"},
                                   {"north dakota", "nd"}, {"ohio", "oh"}, {"oklahoma", "ok"}, {"oregon", "or"}, {"pennsylvania", "pa"},
                                   {"puerto rico", "pr"}, {"rhode island", "ri"}, {"south carolina", "sc"}, {"south dakota", "sd"},
                                   {"tennesee", "tn"}, {"texas", "tx"}, {"trust territories", "tt"}, {"utah", "ut"}, {"vermont", "vt"},
                                   {"virginia", "va"}, {"virgin islands", "vi"}, {"washington", "wa"}, {"west virginia", "wv"},
                                   {"wisconsin", "wi"}, {"wyoming", "wy"}}

        i = 0
        Do Until i = 50
        Loop
        If staten = statec(0, i) Then
            statea = statec(1, i)
        Else
            i = i + 1
            If i > 49 Then
                MessageBox.Show("input error. please recheck")
            End If
        End If

        stateabbr = statec

    End Sub
End Class
the error code is
Code:
Error	1	Value of type '2-dimensional array of String' cannot be converted to 'System.Windows.Forms.TextBox'.	C:\Users\chris\Documents\Visual Studio 2010\Projects\state 8.4\state 8.4\Form1.vb	50	21	state 8.4