Type | Description | |||
Icon as Variant |
A Variant expression that specifies the icon to add or insert, as one of the
following options:
If the Icon parameter is 0, it specifies that the icon at the given Index is removed. Furthermore, setting the Index parameter to -1 removes all icons. By default, if the Icon parameter is not specified or is missing, a value of 0 is used. | |||
Index as Variant |
A long expression that defines the index of the icon to insert or remove, as
follows:
By default, if the Index parameter is not specified or is missing, a value of -1 is used. |
Return | Description | |||
Long | A long expression that indicates the index of the icon in the images collection |
Use the ReplaceIcon property to add, remove or replace an icon in the control's images collection. Also, the ReplaceIcon property can clear the images collection. Use the Images method to attach a image list to the control. The user can add images at design time, by drag and drop files to control's images holder. The ShowImageList property available for the /COM shows or hides the control's images holder at design mode.
The following VB sample adds a new icon to control's images list:
i = ExSchedule1.ReplaceIcon( LoadPicture("d:\icons\help.ico").Handle), i specifies the index where the icon is added
The following VB sample replaces an icon into control's images list::
i = ExSchedule1.ReplaceIcon( LoadPicture("d:\icons\help.ico").Handle, 0), i is zero, so the first icon is replaced.
The following VB sample removes an icon from control's images list:
ExSchedule1.ReplaceIcon 0, i, where i specifies the index of icon removed.
The following VB clears the control's icons collection:
ExSchedule1.ReplaceIcon 0, -1
The Images method loads icons to the control, HTMLPicture assigns a key to a picture object, and the Pictures collection handles the identifiers of the pictures that can be used in the Pictures or ExtraPictures properties.
In order to display an icon or a picture in the control you need first to load the icons or the pictures you plan to display, using the Images method, HTMLPicture, or Add method of the ExPictures collection. The Images collection can display only 16x16 icons, while the HTMLPicture, or Add method can load and display custom sized pictures. The Width/Height property specifies the width and height of the picture to be displayed in the event's body.
The event can display icons, pictures several ways as follows:
The Pictures and ExtraPictures may display one or more pictures at the time. The , character indicates the separator of pictures in the same line, while the / character divides the lines to show the pictures. For instance, "1,2" displays icon with the index 1 and 2 on the same line, while the "1/2,pic1" displays the first icon on the first line, the second icon and the picture pic1 on the second line.