Can anyone give me a hint to solve this problem ???
The listview is limited to 32768 items! Therefore, if you need to work with
that much items, you have some options:
1. Limit the number of items that a shown at a time! For example, if you are
showing names in it, simly add buttons or any selection field with letters
a-z, so only names from that letter are shown at a time. Think about this
carefully! Does it REALLY make sense to show 32768 items or wouldn't it be
better for the user to make some kind of pre-selection? If you search for
"Wilson", its surely faster to select "W" and scroll through those 500 names
as having "Abraham" to "Zulu" in the list and searching for "Wilson" in
32000 items.
2. Develop an user-defined listview-control that will show that much items
3. Buy a third-party listview-control that will hold that much items or see
if you can get a free one from any source-code sites
Regards,
Mathias Wuehrmann
"Gerhard Rock" <gerhar...@joanneum.ac.at> schrieb im Newsbeitrag
news:302801c19ce5$c67e62e0$95e62ecf@tkmsftngxs02...
Well.....what you really need to do is consider a design change. 99.9% of
users are NOT going to like scrolling through 32000+ items in the ListView.
However, by adding the following line of code to both the Item_Click and
Item_Check events, you can work-around the specific problem you're having.
Set Item = ListView1.SelectedItem
Naturally, use the actual name of your ListView control.
Mike
I'm afraid you are incorrect. The ListView has no inherent limit, other
than available memory. The problem Gerhard described appears to be a bug,
although I can neither confirm nor deny that as a fact. Try this code:
Option Explicit
Private Sub Form_Click()
Dim Index As Long
MousePointer = vbHourglass
With ListView1.ListItems
For Index = 1 To 50000
.Add , , CStr(Index)
Next
End With
MousePointer = vbDefault
End Sub
Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
MsgBox Item.Text
Set Item = ListView1.SelectedItem
MsgBox Item.Text
End Sub
When you click a ListItem, the first msgbox will display 1 if the ListItem
is greater than 32768, just as Gerhard described. However, the second
msgbox will display the correct text for the ListItem that was clicked.
Incidently, this was VB6 and the VB6 version of Windows Common Controls. I
didn't test any of this with VB5 or the VB5 version of Windows Common
Controls. I also have no idea if you might run into this same problem
elsewhere. The best solution is to reduce the number of ListItem objects.
32000 is WAY too many.
Mike
oh, I just had this in my mind - seems like I mixed it with limitations of
some other control (combo box?). Thanks for correcting me.
Regards,
Mathias Wuehrmann
"MikeD" <nob...@nowhere.edu> schrieb im Newsbeitrag
news:#nrTbuVnBHA.2488@tkmsftngp03...