我有两个按钮一个文本框和一个列表框。我在一个显示在列表框中的文本框中输入了 25 个数字。我必须如何从该列表框中创建一个数组名称并将它们按顺序显示在另一个列表框中。这是我能弄清楚的最后一步。任何建议都会有所帮助
评论中的代码
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If ListBox5Box.Items.Count < 20 Then 'this works
MessageBox.Show("Exactly Twenty Numbers Must Be Entered")
ListBox6.Items.Add(GoLstBox5.Text)'this does not work nothing comes over to listbox6
Dim beerArray(19) As Integer beerArray(19) = GoLstBox.Text Array.Sort(beerArray)'this will work once the other works
For i = 0 To beerArray.GetUpperBound(0)
ListBox6.Items.Add(beerArray(i).ToString)
Next
我现在有了这个,但新列表框中没有显示任何内容
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If ListBox1.Items.Count < 20 Then
MessageBox.Show("Exactly Twenty Numbers Must Be Entered")
' ListBox6.Items.Add(GoLstBox.Text)
Dim beerArray(ListBox1.Items.Count - 1) As Object
Listbox1.Items.CopyTo(beerArray, 0)
Array.Sort(beerArray)
For i = 0 To beerArray.GetUpperBound(0)
ListBox6.Items.AddRange(beerArray)
Next
End If
End Sub
...