itemPictureType

Type: Integer array

The itemPictureType property enables the type of picture of each item in a ListBox control or a ComboBox control to be obtained or set. This property contains a reference to an array of integer values with the same number of items as returned by the listCount method.

By default, the picture type of each entry in a list box is set automatically, according to whether it has subitems and is expanded or not.

The settings of the itemPictureType property are listed in the following table.

ComboBox or ListBox Class Constant Value Description
ItemPictureType_Closed 0 Entry with subitems closed
ItemPictureType_Open 1 Entry with subitems open
ItemPictureType_Leaf 2 Entry with no subitems

The automatic value can also be determined by using the itemHasSubItems or itemExpanded method.

If the user wants to manually control which picture is displayed, the picture type of an entry can be set. However, no automatic assignment of the picture is made for that entry from then on. This process could be used in situations where the subitems are not loaded until the entry is expanded.

The following examples show the use of the itemPictureType property.

// Change picture to the open book
foreach count in 1 to listBoxCustomer.listCount do
    listBoxCustomer.itemPictureType[count] := ListBox.ItemPictureType_Open;
endforeach;

loadListBox updating;
vars
    prod  : Product;
    count : Integer;
begin
    if app.myCompany.allProducts <> null then
        foreach prod in app.myCompany.allProducts do
            listInstances.addItem(prod.display);
            count := 1;
            if prod.logo <> null then
                listInstances.itemPictureType[count] :=
                                      ListBox.ItemPictureType_Leaf;
            endif;
            count := count + 1;
        endforeach;
    endif;
end;