PictureName[ ]

Applies to

TreeView, PictureListBox, DropDownPictureListBox, Toolbar controls

Description

The PictureName[ ] property specifies an indexed array of files containing the pictures used in the control. You can add pictures to the array in the painter, or use the AddPicture function at execution. However, adding or deleting pictures during execution does not update the PictureName property array.

The pictures can be in the following formats:

  • bitmap (.BMP)

  • GIF (.GIF)

  • JPEG (.JPG or .JPEG)

  • icon (.ICO)

Usage

In a painter

To add pictures to the PictureName array:

  1. Select the Pictures tab page from the control's Properties view.

  2. Do one of the following:

    • In the rows provided in the Picture Name field, type the complete path and name of the files containing the desired pictures.

    • Use the Browse button.

    • Select one or more pictures from the Stock Pictures list.

In scripts

The PictureName property array is populated at initialization and cannot be updated during execution.

The following example adds a picture to a TreeView control and associates it with a new TreeView item:

long ll_tvi
integer li_pic
li_pic = tv_1.AddPicture("c:\images\new.gif")
ll_tvi = tv_1.FindItem(RootTreeItem!, 0)
tv_1.InsertItemFirst(ll_tvi, "New", li_picture)