TVirtualListBox     D2 D3
 Information Version
1.0
Date
Nov. 20, 1996
Size
2k
 Author John Cardinal
 Description VirtList implements 2 "virtual listbox" components, TCustomVirtualListBox and TVirtualListBox, which are extensions of the owner-drawn listbox. These use the Windows 95 LBS_NODATA style to specify a no-data listbox. A no-data listbox is very similar to an owner-drawn listbox, except that Windows does not manage the data for the list: the listbox contains no item data.
Using the class is simple: you drop the component on the form, specify the properties, and implement an OnDrawItem (TDrawItemEvent) procedure. This procedure is passed the line number to be drawn. It's up to you to decide what to draw. Typically, the line number will index a data structure maintained by your application.
A no-data listbox does not have an Items property, because, well... that's the whole idea, isn't it? There is no Sorted property, either, because the no-data listbox doesn't know how to move items around.
The virtual listbox has one important new property: Count. The value of Count determines how many items are displayed. It replaces Items.Count, which isn't accessable because the Items property isn't public/published.
There is also a ScrollBars property, which is missing from the standard TListBox component. (Why?)
Includes source code.