vb源码 listbox超过32767行怎么办?分享编程源码,函数直接可以使

前端之家收集整理的这篇文章主要介绍了vb源码 listbox超过32767行怎么办?分享编程源码,函数直接可以使前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
超过32767时listcount,listindex都不正常了

我的文件数据比较大,
大概有50000多行.
一行一行写到listBox里面以后,
最后需要用到listcount的值,
但是居然得了个负值.
仔细检查了一下,
发现从0到32767还是正常,
但是紧接着ListCount的值就变成了-32768
然后从-32768开始增加下去了,-32767,-32766,-32765.......

请教各位高手!
这到底是怎么回事?
急!
也恳请各位为我UP!!多谢多谢!!!
Private Declare Function SendMessage Lib "user32 " Alias "SendMessageA" (ByVal hwnd As Long,ByVal wMsg As Long,ByVal wParam As Long,lParam As Any) As Long


Private Const LB_GETCOUNT = &H18B '获取ListBox控件行数
Private Const LB_GETCURSEL = &H188 '获取ListBox控件当前选中第几行
Private Const LB_SETCURSEL = &H186 'ListBox控件设置选择第几行

Private Sub Command2_Click()
Dim Count As Long
Count = SendMessage(List1.hwnd,LB_GETCOUNT,0)
End Sub

Private Sub Command3_Click()
dim id as long
id = SendMessage(List1.hwnd,LB_GETCURSEL,0)
End Sub

Private Sub Command4_Click()
call SendMessage(List1.hwnd,LB_SETCURSEL,200,0)
End Sub

原文链接:https://www.f2er.com/vb/260906.html

猜你在找的VB相关文章