viksoe.dk

Virtual List control

Virtual List control


This article was submitted .


The Virtual List ActiveX control adds speed, almost unlimited number of entries and page scroll buttons to the regular list control.

This was my first ActiveX control. I wanted to add the virtual (or owner-data) capabilities of the ListView control to the Visual Basic programmer.
The virtual control can handle an outrageous number of items. Specifically, the control can support an item count up to 4 billion. This is possible because the overhead of managing item data is placed on the owner. Whenever the list control needs to display an item, it will ask the owner (e.g. the Visual Basic Form) about the displayed data.

The Virtual List control is just as easy to use as the regular List Control in Visual Basic. There are however some differences in the way you set the initial properties and how you manage your data.

How to use it

ItemCount

First of all the ItemCount property is read-write. You must initialise the control by setting this property to the expected number of items the control will display.

GetItem event

The control has one important event that you must supply code for: the GetItem event. This event is fired whenever the control needs to paint a list item. You are responsible for looking up the item's text and return it. You can imagine that this event will fire a lot so careful management (caching) of your item data is important for performance.

Notes

The download was screwed up. I seem to have lost the updated source code. Until I find it again, you'll have to stick with this rather outdated download.

Source Code Dependencies

Microsoft Visual C++ 6.0
Microsoft ATL Library

Installation Guide

  • Copy the OCX to a directory of your choice and register it using the REGSVR32 utility or use VB to browse for it.

Download Files  This software is free!

DownloadOCX File (37 Kb)
Source Code (64 Kb)

To the top