

| Type | Description | |||
| Options as Variant |
Specifies a long expression as follows:
|
| Return | Description | |||
| Variant | A safe array that holds the items in the control. The safe array being returned has two dimensions. The first dimension holds the collection of columns, and the second holds the cells. |
The following VB sample lists the indexes of the items in the control:
Dim v As Variant
For Each v In List1.GetItems(1)
Debug.Print v
Next
The following VB sample gets the items from a control and put them to the second one:
With List2
.BeginUpdate
.Columns.Clear
Dim c As EXLISTLibCtl.Column
For Each c In List1.Columns
.Columns.Add c.Caption
Next
.PutItems List1.GetItems
.EndUpdate
End With
The following C++ sample gets the items from a control an put to the second one:
#include "Items.h" #include "Columns.h" #include "Column.h" m_list2.BeginUpdate(); CColumns columns = m_list.GetColumns(), columns2 = m_list2.GetColumns(); for ( long i = 0; i < columns.GetCount(); i++ ) columns2.Add( columns.GetItem( COleVariant( i ) ).GetCaption() ); COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR; COleVariant vtItems = m_list.GetItems( vtMissing ); m_list2.PutItems( &vtItems, vtMissing ); m_list2.EndUpdate();
The following C# sample gets the items from a control and put them to a second one:
axList2.BeginUpdate();
for (int i = 0; i < axList1.Columns.Count; i++)
axList2.Columns.Add(axList1.Columns[i].Caption);
object vtItems = axList1.GetItems("");
axList2.PutItems(ref vtItems);
axList2.EndUpdate();
The following VB.NET sample gets the items from a control and put them to a second one:
With AxList2
.BeginUpdate()
Dim j As Integer
For j = 0 To AxList1.Columns.Count - 1
.Columns.Add(AxList1.Columns(j).Caption)
Next
Dim vtItems As Object
vtItems = AxList1.GetItems("")
.PutItems(vtItems)
.EndUpdate()
End With
The following VFP sample gets the items from a control and put them to a second one:
local i
with thisform.List2
.BeginUpdate()
for i = 0 to thisform.List1.Columns.Count - 1
.Columns.Add( thisform.List1.Columns(i).Caption )
next
local array vtItems[1]
vtItems = thisform.List1.GetItems("")
.PutItems( @vtItems )
.EndUpdate()
endwith