AddStatePicture PowerScript function
Description
Adds a bitmap, icon, or cursor to the state image list.
Controls
ListView and TreeView controls
Syntax
|
1 |
<span>controlname</span>.<span>AddStatePicture</span> ( <span>picturename</span> ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the ListView or TreeView |
|
picturename |
The name of the bitmap, icon, or cursor |
Return Values
Integer. Returns the picture index if
it succeeds and -1 if an error occurs.
Usage
For ListViews in large icon view, the state picture is a picture
displayed to the left of the large picture, by default in a smaller
size. For TreeViews, the state picture is displayed to the left
of the regular picture and the item is moved to the right to make
room for it.
If you specify either StatePictureWidth or StatePictureHeight,
the picture is scaled to the size specified by that property.
When a you add a bitmap, specify the color in the bitmap that
will be transparent by setting the StatePictureMaskColor property
before calling AddPicture. You can change the
StatePictureMaskColor property between calls.
Examples
This example adds the file star.ico to
the state picture index of the ListView lv_files:
|
1 |
//Add state picture |
|
1 |
integer index |
|
1 |
index = lv_files.<span>AddStatePicture</span>("star.ico") |