CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    Memphis
    Posts
    24

    listcount property

    It appears as though the listcount property of a listbox is limited to an integer number. Is there a way to set the listcount property to return a longint value?

    EFD

  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: listcount property

    Hi,

    Do you just want : "the listcount property to return a longint value?", then you can use 'type cast' function Clng, like
    clng(list1.listcount)

    But, if you really have > 32767 no. of elements,
    it is not possible to add that many, in the first place. i.e a code like

    dim i as long
    for i = 1 to 32768
    List1.AddItem "item:" & format(i)
    next i




    gives run time error 5, "Invalid procedure call".
    ( A bug?!, shouldn't it give Err No 6: Overflow?!!) when i = 32768. This code runs fine if the outer limit is 32767.

    Designers of VB must have thought, for sizes that big, it warrents a seperate handling!! You can maintain yourown list of strings and display only a portion of them!!

    Ravi


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured