ICON Statement

Summary: Syntax

ICON text, id, x, y, width, height[[,style]]

This statement defines an icon control belonging to the STATIC class. It creates an icon displayed in the dialog box.

The text field specifies the name of an icon (not a filename) defined elsewhere in the resource file.

The id field takes a unique integer value that identifies the control.

The x and y fields take integer values that specify the x and y coordinates of the upper-left corner of the control. The horizontal units are 1/4 of the dialog base width unit; the vertical units are 1/8 of the dialog base height unit. The current dialog base units are computed from the height and width of the current system font. The GetDialogBaseUnits function returns the dialog base units in pixels. The coordinates are relative to the origin of the dialog box.

For the ICON statement, the width and height fields are ignored; the icon automatically sizes itself.

The optional style field allows only the SS_ICON style described on page 197.

Summary: Comments

The x, y, width, and height fields can use the addition operator (+) for relative positioning. For example, 15 + 6 can be used for the x field.

The default style for ICON is SS_ICON.

The following example demonstrates the correct usage of the ICON statement:

ICON “myicon” 901, 30, 30