ListItem Interface Reference

A ListItem object represents one item in an ListView. More...

List of all members.

Public Member Functions

 SetPosition ([in] ULONG Left,[in] ULONG Top)
 Sets the position of the object.

Properties

BSTR RW Text []
 Returns or sets the text of the object.
LONG RW ImageIndex []
 The ImageIndex in the ListView's ImageList.
VARIANT_BOOL RW Selected []
 Gets or sets the selection state of the item.
VARIANT_BOOL RW Checked []
 The Checked property is a Boolean value that indicates that the item is checked or not.
BSTR RW SubItems [[in] LONG Index] []
 Gets or sets the text of an subitem.
LONG RW SubItemImage [[in] LONG Index] []
 Gets or sets the image index of an subitem.
LONG R Index []
 Returns the index of the item in the ListView's items collection.
VARIANT RW UserData []
 The UserData property is provided for the convenience of developers.
BSTR RW Hint []
 Returns or sets the hint of the object.
ULONG RW Group []
 Returns or sets the group number of the object.
LONG RW Left []
 Gets or sets horizontal position of the object.
LONG RW Top []
 Gets or sets vertical position of the object.
IDispatch *RW Font []
 Returns or sets the Font for the item.
ULONG RW TextBkColor []
 Returns or sets the background color for the item.
IDispatch *R SubItemsEx [[in] LONG Index] []
 Returns the ListSubItem object for an subitem.


Detailed Description

A ListItem object represents one item in an ListView.


Member Function Documentation

SetPosition ( [in] ULONG  Left,
[in] ULONG  Top 
)

Sets the position of the object.

Control must have work areas (WorkAreas). Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

fs = new ActiveXObject("Scripting.FileSystemObject")

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

f.ClientWidth = 450
f.ClientHeight = 550
f.CenterControl()
f.Text = "ListView Work Areas Demo"

f.BorderWidth = 10
f.MinWidth = 500
f.MinHeight = 350

Box = f.CreateListView(10,10,250,300)
Box.HotTrack = true
Box.Align = o.Translate("AL_CLIENT")

Ext = new ActiveXObject("Scripting.WindowSystemObjectExtensions")
Box.LargeImages = Ext.SystemImageListLarge

Box.WorkAreas.Add(10,10,180,180)
Box.WorkAreas.Add(200,200,200,200)

for (i = 0; i<10; i++)
{
        Item = Box.Add("Item "+i)
        Item.ImageIndex = Ext.GetFileSysIconIndexLarge("1.txt",o.Translate("FILE_ATTRIBUTE_ARCHIVE"))
        if ((i % 2) == 0)
        {
                Item.SetPosition(210,210)
        }
}
Box.Arrange()

f.Show()

o.Run()
Result:
ListViewWorkAreas.jpg
Since:
1.1.10.


Property Documentation

VARIANT_BOOL RW Checked

The Checked property is a Boolean value that indicates that the item is checked or not.

IDispatch* RW Font

Returns or sets the Font for the item.

Property CustomDraw of the parent ListView control must be "TRUE".

Since:
1.1.12.

ULONG RW Group

Returns or sets the group number of the object.

Control must have groups (Groups). Example:

o = new ActiveXObject("Scripting.WindowSystemObject")
o.EnableVisualStyles = true

fs = new ActiveXObject("Scripting.FileSystemObject")

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

f.ClientWidth = 550
f.ClientHeight = 650
f.CenterControl()

Box = f.CreateListView(10,10,250,300)
Box.HotTrack = true
Box.Align = o.Translate("AL_CLIENT")

Ext = new ActiveXObject("Scripting.WindowSystemObjectExtensions")
Box.LargeImages = Ext.SystemImageListLarge
Box.SmallImages = Ext.SystemImageListSmall
Box.Style = o.Translate("LV_VIEW_ICON")

var Data = ["1.txt","1.jpg","1.png","1.exe","1.bat","1.com","1.js","1.vbs","1.bmp","1.ini","1.xml"]

Group1 = Box.Groups.Add("Group 1")
Group2 = Box.Groups.Add("Group 2")

Group1.SubTitle = "The group 1 description where"
Group1.Task = "Task"
Group1.DescriptionTop = "DescriptionTop"
Group1.DescriptionBottom = "DescriptionBottom"
Group1.SubsetTitle = "SubsetTitle"
Group1.HeaderAlign = o.Translate("AL_CENTER")
Group1.FooterAlign = o.Translate("AL_CENTER")
Group1.Collapsible = true
Group1.Footer = "Group 1 Footer Text"
Group2.Footer = "Group 2 Footer Text"

for (i = 0; i<Data.length; i++)
{
        Item = Box.Add("Item "+i+": "+Data[i])
        Item.ImageIndex = Ext.GetFileSysIconIndexLarge(Data[i],o.Translate("FILE_ATTRIBUTE_ARCHIVE"))
        Item.SubItems(0) = "The first line for "+i
        Item.SubItems(1) = "The second line for (a b c d e f g h j k)"+i
        Item.Group = i % 2
}

Box.OnGroupLinkClick = OnGroupLinkClick

function OnGroupLinkClick(Sender,Group){
        f.MessageBox(Group.Header + " clicked")
}


f.Show()

o.Run()

Result:
ListViewGroups.jpg
Since:
1.1.10.

BSTR RW Hint

Returns or sets the hint of the object.

InfoTip must be "TRUE".

Since:
1.1.10.

LONG RW ImageIndex

The ImageIndex in the ListView's ImageList.

LONG R Index

Returns the index of the item in the ListView's items collection.

LONG RW Left

Gets or sets horizontal position of the object.

Control must have work areas (WorkAreas). Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

fs = new ActiveXObject("Scripting.FileSystemObject")

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

f.ClientWidth = 450
f.ClientHeight = 550
f.CenterControl()
f.Text = "ListView Work Areas Demo"

f.BorderWidth = 10
f.MinWidth = 500
f.MinHeight = 350

Box = f.CreateListView(10,10,250,300)
Box.HotTrack = true
Box.Align = o.Translate("AL_CLIENT")

Ext = new ActiveXObject("Scripting.WindowSystemObjectExtensions")
Box.LargeImages = Ext.SystemImageListLarge

Box.WorkAreas.Add(10,10,180,180)
Box.WorkAreas.Add(200,200,200,200)

for (i = 0; i<10; i++)
{
        Item = Box.Add("Item "+i)
        Item.ImageIndex = Ext.GetFileSysIconIndexLarge("1.txt",o.Translate("FILE_ATTRIBUTE_ARCHIVE"))
        if ((i % 2) == 0)
        {
                Item.SetPosition(210,210)
        }
}
Box.Arrange()

f.Show()

o.Run()
Result:
ListViewWorkAreas.jpg
Since:
1.1.10.

VARIANT_BOOL RW Selected

Gets or sets the selection state of the item.

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

Gets or sets the image index of an subitem.

Note:
Additional columns visible only when Style = LVS_REPORT.
Parameters:
Index Specifies the zero-based index of the subitem.

BSTR RW SubItems[[in] LONG Index] (  ) 

Gets or sets the text of an subitem.

Note:
Additional columns visible only when Style = LVS_REPORT.
Parameters:
Index Specifies the zero-based index of the subitem.

IDispatch* R SubItemsEx[[in] LONG Index] (  ) 

Returns the ListSubItem object for an subitem.

Note:
Additional columns visible only when Style = LVS_REPORT.
Parameters:
Index Specifies the zero-based index of the subitem.
Since:
1.1.12.

BSTR RW Text

Returns or sets the text of the object.

ULONG RW TextBkColor

Returns or sets the background color for the item.

Property CustomDraw of the parent ListView control must be "TRUE". If COLOR_NONE then component's color used. Default value: COLOR_NONE.

Since:
1.1.12.

LONG RW Top

Gets or sets vertical position of the object.

Control must have work areas (WorkAreas). Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

fs = new ActiveXObject("Scripting.FileSystemObject")

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

f.ClientWidth = 450
f.ClientHeight = 550
f.CenterControl()
f.Text = "ListView Work Areas Demo"

f.BorderWidth = 10
f.MinWidth = 500
f.MinHeight = 350

Box = f.CreateListView(10,10,250,300)
Box.HotTrack = true
Box.Align = o.Translate("AL_CLIENT")

Ext = new ActiveXObject("Scripting.WindowSystemObjectExtensions")
Box.LargeImages = Ext.SystemImageListLarge

Box.WorkAreas.Add(10,10,180,180)
Box.WorkAreas.Add(200,200,200,200)

for (i = 0; i<10; i++)
{
        Item = Box.Add("Item "+i)
        Item.ImageIndex = Ext.GetFileSysIconIndexLarge("1.txt",o.Translate("FILE_ATTRIBUTE_ARCHIVE"))
        if ((i % 2) == 0)
        {
                Item.SetPosition(210,210)
        }
}
Box.Arrange()

f.Show()

o.Run()
Result:
ListViewWorkAreas.jpg
Since:
1.1.10.

VARIANT RW UserData

The UserData property is provided for the convenience of developers.

It can be used for storing an additional value.


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