method Button.Images (Handle as Variant)
Sets at runtime the control's image list. The Handle should be a handle to an Image List Control.

TypeDescription
Handle as Variant The Handle parameter can be:
  • A string expression that specifies the ICO file to add. The ICO file format is an image file format for computer icons in Microsoft Windows. ICO files contain one or more small images at multiple sizes and color depths, such that they may be scaled appropriately. For instance, Images("c:\temp\copy.ico") method adds the sync.ico file to the control's Images collection (string, loads the icon using its path) 
  • A string expression that indicates the BASE64 encoded string that holds the icons list. Use the Exontrol's ExImages tool to save/load your icons as BASE64 encoded format. In this case the string may begin with "gBJJ..." (string, loads icons using base64 encoded string)
  • A reference to a Microsoft ImageList control (mscomctl.ocx, MSComctlLib.ImageList type) that holds the icons to add (object, loads icons from a Microsoft ImageList control)
  • A reference to a Picture (IPictureDisp implementation) that holds the icon to add. For instance, the VB's LoadPicture (Function LoadPicture([FileName], [Size], [ColorDepth], [X], [Y]) As IPictureDisp) or LoadResPicture (Function LoadResPicture(id, restype As Integer) As IPictureDisp) returns a picture object (object, loads icon from a Picture object)
  • A long expression that identifies a handle to an Image List Control ( the Handle should be of HIMAGELIST type ). On 64-bit platforms, the Handle parameter must be a Variant of LongLong / LONG_PTR data type ( signed 64-bit (8-byte) integers ), saved under llVal field, as VT_I8 type. The LONGLONG / LONG_PTR is __int64, a 64-bit integer. For instance, in C++ you can use as Images( COleVariant( (LONG_PTR)hImageList) ) or Images( COleVariant( (LONGLONG)hImageList) ), where hImageList is of HIMAGELIST type. The GetSafeHandle() method of the CImageList gets the HIMAGELIST handle (long, loads icon from HIMAGELIST type)
Use the Images method to load a list of icons to the button. The ImageSize property defines the size (width/height) of the icons within the control's Images collection. Use the Image property to assign a picture/image to the button.

The following sample adds two icons to the control's images list and change the button's icon when user clicks the button:

Private Sub Button1_Click()
With Button1
    .BeginUpdate
        .Image = (.Image) Mod 2 + 1
    .EndUpdate
End With
End Sub

Private Sub Form_Load()
With Button1
    .BeginUpdate
        .Mode = exPushLike
        .Images "gBJJgBggAAwAAgACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjIgjIBAEijUlk8plUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwV/QGFiT/weJrcPw4AYGPxuKyVKwqAxuMx7AxuZyOTz09xmYyGhh2O0elzmMz+rl2Vy+o0+I1Ol0Wa2ud1mf0my2Ob3sYy3A3220u5yWu1235XFAGW2eI4Wq42e6ENjPIw3L6uW3fX3HT43V7eG5OwzXC6PM8HrlnYy3u4ff9nz1vk+3vw30/U6+H7/z/wBAMBJ4iofJVAyOo+kKRgAkiTwcm7pQGlL1IwebqoycEMIwcAfpSYAHw+AaUkBCDrxMjMRpTFSNEAA6UnBF6TnxEKTn9GqNH+T8KQ2ACAg=="
        .Images "gBJJgBggAAwAAgACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjIgjIBAEijUlk8plUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wE8QCAjGDwOHsDAxUSf+MAGGxGRp+Qh+OyuKYAAzGPwmSz1DzeXxeb0mLweEyuQz+rmWUh2W1+lzOb0+wxupzus3UZ0Ox0e/2emw2V4mv0XBzO7xGu2/G33IzXC1HOxuy6PQ5WH3vV4HX7214vN8XezfZ1nh8nd8HU73m90w9Hr8e4wnW8vv/Er+PD9no+78wAjL6Nslj/wDA6UvQjTjwRBqWvQysHQlCbWIqHyVQujqPpCkYAJIk8PpvCMKJUebGpOcETo0cAfpSYAHxcAaUtyjUaJfEKMkBHCMGBHYAHglR/JVFUFmDBJxpSgI"
        .Image = 1
    .EndUpdate
End With
End Sub