程序代码:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For i = 0 To 2
ListBox1.Items.Add(InputBox("添加第" & i + 1 & "个项目"))
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim inputStr As String = InputBox("输入要删除的数据")
For i = 0 To ListBox1.Items.Count - 1
If ListBox1.Items(i).ToString = inputStr Then
ListBox1.Items.RemoveAt(i)
Exit For
End If
Next
End Sub
我看的描述为啥跟下面的Text1没啥关系啊