VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Mike's VirtualListbox (update 5/19/03)

by Michael L. Canejo (28 Submissions)
Category: VB function enhancement
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (12 Votes)

The reason i wrote this class and project demo was because
the vb listbox control is a great, fast
and easy way of storing large amounts of
information in memory and then being able
to retreive that info after from an organized
list w/indexed items etc. But.. What you will see in this
class is the exact same thing as the
vb listbox control except for the activex control
interface of course (not a bad idea if you wanted to make one with this class). I also wrote functions in this
class that arent included within the vb
listbox control, such as RemoveDuplicates,
ResizeList, RemoveItemByString, and FindItem.
This class is faster than vbs listbox because
the vb listbox is a memory hog (when it's listcount is in the thousands) because of the graphic
routines and cause of this its slow as well.
If all your using the vb listbox for is to store info, like
i said earlier, then this is a better substitute since it's just code based and faster; not to mention it can hold more than 32k items.
The great part about this is you can just keep
adding functions and your own routines or modify
mine to your own liking. What you can learn from
this class is the following:
(1) How to use and create property functions
in classes such as Property Get or Property Let.
(2) How to use arrays and their features in vb,
such as UBound and LBound, redeclaring arrays,
and how to preserve them as well. Enjoy :) [update, added SetItem sub to store info as well as read infro from the listbox. I forgot to add this long ago)

Assumes
To use this class, if you havnt added to your project yet then do so now and then on the form, class, or module you need to use this virtuallistbox, simple enter the following line: Dim List1 As New VirtualListbox (Where List1 is the name you want to call it) Written by: Mike Canejo AOL/AIM: Mikey3dd Email: [email protected]

Rate Mike's VirtualListbox (update 5/19/03)

Upload

Download this snippet    Add to My Saved Code

Mike's VirtualListbox (update 5/19/03) Comments

No comments have been posted about Mike's VirtualListbox (update 5/19/03). Why not be the first to post a comment about Mike's VirtualListbox (update 5/19/03).

Post your comment

Subject:
Message:
0/1000 characters