# ILButton

> ILButton( | HBtn, |  |
> | Images, |  |
> | Cx | = | 16,
> | Cy | = | 16,
> | Align | = | "Left",
> | Margin | = | "1 1 1 1" | )

Creates an ImageList and associates it with a button.

#### Parameters

HBtn | Handle of a buttton.
Images | A pipe delimited list of images in form “FileName[:zeroBasedIndex]” or ImageList handle. Any position can be omitted in which case icon for state “normal” is used.
Cx | Width of the image in pixels. By default 16.
Cy | Height of the image in pixels. By default 16.
Align | One of the word: Left (default), Right, Top, Bottom, Center.
Margin | Margin around the icon. A space separated list of four integers in form “left top right bottom”.

#### Images

- File must be of type exe, dll, ico, cur, ani or bmp.
- There are 5 states: normal, hot (hover), pressed, disabled, defaulted (focused), stylushot.
- If only one image is specified, it will be used for all the button’s states
- If fewer than six images are specified, nothing is drawn for the states without images
- Omit “file” to use the last file specified ( “states.dll:0|:1|:2|:3|:4|:5” )
- Omitting an index is the same as specifying 0.

#### Returns

Handle of the ImageList if operation was completed or 0 otherwise.

#### Remarks

Within Aero theme (WinOS >= Vista), a defaulted (focused) button fades between images 5 and 6. Each succesifull call to this function creates new ImageList. If you are calling this function more times for single button control, freeing previous ImageList is your responsibility.

#### About

- Version 1.0 by majkinetor.
- Original code by tkoi. See http://www.autohotkey.com/forum/viewtopic.php?p=247168
- Minimum operating systems: Windows XP.
- Licensed under GNU GPLv3 http://www.opensource.org/licenses/gpl-3.0.html

Close