下面是我将数据输入数组并检索信息的代码
输入数据似乎没有问题,但是当我单击按钮检索信息时,它只会在文本框中显示 0。
Public Class Form1
Dim Array(20) As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim counter As Integer
For counter = 0 To ListBox1.Items.Count - 1
Array(counter) = txtEnterMarks.Text(counter)
Next
Label1.Text = "omfg"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
For counter = 0 To Array.Length - 1
ListBox1.Items.Add(Array(counter))
Next
End Sub
End Class