list view max capacity 
Author Message
 list view max capacity

Hi,
  Anybody know what the maximum capacity of a list view is,
or how to find such information?

thanks,

mark



Tue, 21 Sep 2004 01:20:21 GMT  
 list view max capacity
Help says... ListItem Object, ListItems Collection

listview.ListItems(index) ->> index Either an integer or string .... and
more
Since it's an Integer, it only goes up to 32767.. but even that is too many
to show to a user.

--
Ken Halter
MS-MVP-VB
Please keep it in the groups..

Quote:

> Hi,
>   Anybody know what the maximum capacity of a list view is,
> or how to find such information?

> thanks,

> mark



Tue, 21 Sep 2004 01:31:57 GMT  
 list view max capacity


Quote:
> Help says... ListItem Object, ListItems Collection

> listview.ListItems(index) ->> index Either an integer or string .... and
> more
> Since it's an Integer, it only goes up to 32767.. but even that is too
many
> to show to a user.

Help is incorrect and misleading regarding this.  You can add more than
32767 ListItem objects to a ListView.  The number of ListItem objects you
can add is limited only by available memory. Well, actually it's limited to
the upper limit of a Long, but nobody in their right mind is going to put
2,147,483,647 items in a ListView (as Ken said, 32000+ is way too many).

But a ListView can act weird when you go over 32767 ListItem objects.

Just for grins and giggles, try the following code to see this "weird"
behavior (VB6 SP5 and the VB6 version of ListView control):

Option Explicit

Private Sub Command1_Click()

    MsgBox ListView1.ListItems(40000).Text

End Sub

Private Sub Form_Click()

    Dim Counter As Long

    With ListView1
        .View = lvwReport
        .ColumnHeaders.Add , , "Column"
        For Counter = 1 To 50000
            .ListItems.Add , , "Item " & CStr(Counter)
        Next

        MsgBox "Count: " & CStr(.ListItems.Count)
    End With

    Command1.Enabled = True

End Sub

Private Sub Form_Load()

    Command1.Enabled = False

End Sub

Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)

    MsgBox "Index: " & CStr(Item.Index)

End Sub

Note that when you click "Item 32769" or greater in the ListView, the msgbox
shows it has an index of 1.  But clicking the command button correctly
displays the text for the ListItem object with an index of 40000.  Go
figure. I'd call this a bug in the ListView control, specifically in the
ListItem object since the ListItems collection works fine for indexes >
32768.  What's really baffling is that if you look in Object Browser at the
Index property of a ListItem object, it's a Long. That's why I think it's a
bug, but as far as I know, MS has never acknowledged it as a bug.

Mike



Tue, 21 Sep 2004 11:59:40 GMT  
 list view max capacity


Quote:



> But a ListView can act weird when you go over 32767 ListItem objects.

I have a similar problem with a list box, that I have never been able to
resolve.
The row source for this list is a query, sorted on a date. If the number
of records in the query is too long ( round about 150) it can be
impossible to see the end of the list. If you click the down arrow on the
scroll bar the list scrolls and, with luck, it will reach the end. On the
other hand, if you drag down the square box for faster access, when the
box is at the bottom the list shown is only about three-quarters down the
actual query. Nothing you can do now will allow access to the missing
quarter, apart from changing the query criteria to another set of data,
then back again. Then using the down arrow and waiting patiently for the
end of the list to show will usually work.

Dave



Tue, 21 Sep 2004 23:37:46 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. **** List Box - Max Capacity ??? *******

2. Access Max Record Capacity

3. List Box Control Capacity

4. List View Top Item in Large Icon View

5. tree view and list view..

6. Tree View / List View

7. List View to Tree View

8. Highlighting a Entire row in list view with Report view as its style

9. Tree View & List View Icons

10. Display Bitmaps in Sub Items and column Headers of List View During Report View

11. Drop List in a List VIew or a Data Grid control

12. Drop-down list in a list view

 

 
Powered by phpBB® Forum Software