phoExternalButtonImageList - Button
Handle for a custom imagelist that holds custom images for different button states
Type: Property
Access: Read/Write
Data Type: Handle
Parameters: None
Syntax
Property Handle phoExternalButtonImageList
| Access Type | Syntax |
|---|---|
| Read Access: | Get phoExternalButtonImageList to HandleVariable |
| Write Access: | Set phoExternalButtonImageList to HandleVariable/Value |
Description
If you wish to assign a button a custom image list, you may do this by creating an image list using cImageList32 and assigning it to phoExternalImageList. If you do this, psImage and piImageSize are ignored.
Buttons support 6 image states: normal, hot, pressed, disabled, defaulted, stylus-hot. Your custom image list should contain 1 or 6 images. If the image list has 1 image, this image is used for all states. If 6 images are defined, each is assigned to the appropriate state.
Sample
This sample shows how to assign 6 different images to an extrernal image list and how to assign that image list to a button's phoExternalButtonImageList property.
// Buttons have 6 image states.
// We will provide a different image for each of these states.
Object oImageList is a cImageList32
Set piMaxImages to 6
Set piImageHeight to 16
Set piImageWidth to 16
Procedure OnCreate
Integer iIndex
// for buttons, either create 1 image or 6
// if 6, they are normal, hot, pressed, disabled, defaulted, stylus-hot
Get AddImage "ClosFold.bmp" to iIndex
Get AddImage "OpenFold.bmp" to iIndex
Get AddImage "OpenFold.bmp" to iIndex
Get AddImage "ClosFold.bmp" to iIndex
Get AddImage "OpenFold.bmp" to iIndex
Get AddImage "ClosFold.bmp" to iIndex
End_Procedure
End_Object
// This attaches to an external image list with 6 images.
// Because this uses an external image list, you will not see the image modeled in the Studio
Object oMultiImageButton is a Button
Set Location to 65 194
Set phoExternalButtonImageList to oImageList
Set peImageAlign to Button_ImageList_Align_Center
Procedure OnClick
End_Procedure
End_Object