ListBox控件容纳数据数目超过int型后?
glsw6 2004-05-11 04:29:12 我用中ListBox控件放了3万多条数据,想通过别的控件控制ListBox中选择的条目,但发现当ListIndex属性超过int型后就不好用了,如下:
Private Sub text1_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 38 '按下了”上“键
If list1.Visible Then
If list1.ListIndex > 0 Then
list1.ListIndex = list1.ListIndex - 1
End If
End If
KeyCode = 0
text1.Text = list1.List(list1.ListIndex)
Case 40 '按下了”下“键
If list1.Visible Then
If list1.ListIndex < list1.ListCount - 1 Then
list1.ListIndex = list1.ListIndex + 1
End If
End If
KeyCode = 0
text1.Text = list1.List(list1.ListIndex)
End Select
End Sub
运行时,前面的条目按"上"键好使,但所有按”下“键都不好用,请问有什么方法可以实现类似的功能?谢谢!