哪位大神看看这个 帮忙做一下感激不尽啊 这东西看得我真是一脸懵逼
1个回答
展开全部
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then '回车键
List1.AddItem Combo1.Text
Combo1.Clear
ElseIf (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then '输入的是非0-9和退格键
KeyAscii = 0
End If
End Sub
Private Sub Command1_Click()
Dim max As Integer, min As Integer, tmp As Integer
max = 0: min = 0
For i = 1 To List1.ListCount - 1
If Val(List1.List(i)) > List1.List(max) Then max = i
If Val(List1.List(i)) < List1.List(min) Then min = i
Next
tmp = List1.List(0): List1.List(0) = List1.List(min): List1.List(min) = tmp
tmp = List1.List(List1.ListCount - 1): List1.List(List1.ListCount - 1) = List1.List(max): List1.List(max) = tmp
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询