IconSize Property
The fixed size of the button's icon.
Definition
Property "OLE.IconSize" as Record
Values
This property is a record with the following structure:
| Pos | Name | Type | Description | Default |
|---|---|---|---|---|
| <1, 1> | Width | Integer | The forced icon width | 0 |
| <1, 2> | Height | Integer | The forced icon height | 0 |
Remarks
The IconSize property allows you to force icons to a certain size. The
format is Width:@FM:Height, or as a shorthand, you can also use WxH.
When you set this property, any icon you set will be resized to fit
those exact dimensions. This can be useful if you have a library of
stock images that are too large or too small for your buttons. For
example, if I set this property to 16x16 and then set a 24x24 icon,
the icon will be resampled to 16 x 16 when rendered.
To use the icon's original size, set the width and height to 0.
tip
You can also set the fixed icon size in the Form Designer using the IconWidth and IconHeight properties.
Example
// Force any icon loaded to 16x16
Set_Property(@Window:".OLE_BUTTON", "OLE.IconSize", 16:@FM:16)
// Force any icon loaded to 32x32 using the cool shorthand notation
Set_Property(@Window:".OLE_BUTTON", "OLE.IconSize", "32x32")
// Use the icon's original size
Set_Property(@Window:".OLE_BUTTON", "OLE.IconSize", "0x0")