ListControl Interface Reference

This is the base class of all controls that contains an ordered list. More...

Inheritance diagram for ListControl:

Inheritance graph
Collaboration diagram for ListControl:

Collaboration graph
List of all members.

Properties

LONG RW ItemIndex []
 Gets or sets the index of the currently selected item.
LONG RW ItemHeight []
 Specifies the height of items in the control.
VARIANT RW ItemData [[in] LONG Index] []
 Gets or sets a value associated with the specified item.
VARIANT_BOOL RW Sorted []
 Indicates that the items in the control are sorted alphabetically.
VARIANT_BOOL RW IntegralHeight []
 Specifies that the control automaticly resizes itself so that the control does not display partial items.
LONG RW HorizontalExtent []
 Specifies the width, in pixels, by which the control can be scrolled horizontally.
IDispatch *RW Images []
 Defines which ImageList will be used to display image for each item in the list.
LONG RW ImageIndex [[in] LONG Index] []
 The ImageIndex for an item in the parent controls's ImageList.
VARIANT_BOOL RW CustomDraw []
 When "TRUE" font and colors of an element can be specified in the OnDrawItem event handler.
VARIANT W OnDrawItem []
 Sets the event handler for the OnDrawItem event.
VARIANT W BackgroundImage []
 Specifies the image of the background.
VARIANT_BOOL RW CustomDrawSelection []
 When "TRUE" font and colors of an element in the selection state can be specified in the OnDrawItem event handler.

Detailed Description

This is the base class of all controls that contains an ordered list.

See also ListControlEvents.


Property Documentation

VARIANT W BackgroundImage

Specifies the image of the background.

File name or a Picture object can be used.

Since:
1.1.10.

VARIANT_BOOL RW CustomDraw

When "TRUE" font and colors of an element can be specified in the OnDrawItem event handler.

Default value: "FALSE".

Example:

o = new ActiveXObject("Scripting.WindowSystemObject")
f = o.CreateForm(0,0,0,0)

f.ClientWidth = 250
f.ClientHeight = 220
f.CenterControl()

Box = f.CreateListBox(10,10,250,300)
Box.Align = o.Translate("AL_CLIENT")
Box.Font.Size = 16

for (i = 0; i<10; i++)
{
        Box.Add("Item "+i)
}

function OnDrawItem(Box,Item)
{
        i = Item.Index
        if (i % 2 == 0)
        {
                Item.Font.Color = 0x0000FF00
                Item.Font.Size = 12
        } else
        {
                Item.TextBkColor = 0x00E0E0FF
        }
}

Box.OnDrawItem = OnDrawItem
Box.CustomDraw = true

f.Show()

o.Run()

Result:
ListBoxColors.jpg

Since:
1.1.12.

VARIANT_BOOL RW CustomDrawSelection

When "TRUE" font and colors of an element in the selection state can be specified in the OnDrawItem event handler.

Default value: "FALSE". When CustomDrawSelection = "FALSE" and CustomDraw = "TRUE" font and colors of the element can be specified in the OnDrawItem event handler, but when the element in the selection state system colors will be used for the background and font colors.

See also:
CustomDraw.
Since:
1.1.12.

LONG RW HorizontalExtent

Specifies the width, in pixels, by which the control can be scrolled horizontally.

If the width of the control is smaller than this value, the horizontal scroll bar horizontally scrolls items in the control.

Example (JScript):

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

f = o.CreateForm(0,0,0,0)

f.Text = "WSO"
f.ClientWidth = 350
f.ClientHeight = 180
f.CenterControl()

ListBox1 = f.CreateListBox(10,10,150,150)

with (ListBox1)
{
        for (i = 1; i<50; i++)
                Add("Item "+i)
}

ListBox2 = f.CreateListBox(170,10,150,150)
ListBox2.HorizontalExtent = 300

with (ListBox2)
{
        for (i = 1; i<50; i++)
                Add("Item "+i)
}


f.Show()

o.Run()

Result:

ListBoxHorizontalExtent.jpg

LONG RW ImageIndex[[in] LONG Index] (  ) 

The ImageIndex for an item in the parent controls's ImageList.

Since:
1.1.12.

IDispatch* RW Images

Defines which ImageList will be used to display image for each item in the list.

See also:
ImageIndex.
Since:
1.1.12.

VARIANT_BOOL RW IntegralHeight

Specifies that the control automaticly resizes itself so that the control does not display partial items.

Default value: "TRUE".

VARIANT RW ItemData[[in] LONG Index] (  ) 

Gets or sets a value associated with the specified item.

Parameters:
Index Specifies the zero-based index of the item.

LONG RW ItemHeight

Specifies the height of items in the control.

LONG RW ItemIndex

Gets or sets the index of the currently selected item.

VARIANT W OnDrawItem

Sets the event handler for the OnDrawItem event.

Since:
1.1.12.

VARIANT_BOOL RW Sorted

Indicates that the items in the control are sorted alphabetically.

Default value: "FALSE".


WSO 1.1 Documentation. Date modified:Wed Aug 12 18:12:49 2015. (C) Veretennikov A. B. 2004-2015