listbox中是什么?整数?实数?字符串?
追问是整数

追答 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim max As Integer = 0
Dim min As Integer = 0
For i = 0 To ListBox1.Items.Count - 1
If Val(ListBox1.Items(max)) < Val(ListBox1.Items(i)) Then max = i
If Val(ListBox1.Items(min)) > Val(ListBox1.Items(i)) Then min = i
Next
If min > max Then
ListBox1.Items.RemoveAt(min)
ListBox1.Items.RemoveAt(max)
Else
ListBox1.Items.RemoveAt(max)
ListBox1.Items.RemoveAt(min)
End If
End Sub本回答被提问者采纳