property Button.Image as Variant
Specifies the image being displayed.

 TypeDescription 
   Variant A long expression that indicates the index of icon being displayed, a string expression that specifies the path to a picture file, a Picture object being displayed, a string expression that indicates the BASE64 encoded string that holds a picture/image object. Use the eximages tool to save your picture as base64 encoded format., or a IPictureDisp object that holds the picture being displayed on the button.  
Use the Image property to assign a picture to your button. Use the Images property to add icons to the control. If you have multiple icons added to the Images collection you can use long expression to change the index of icon being displayed. Use the ImageAlignment property to align the image in the button. Use the ImageVAlignment property to align vertically the image in the button. Use the Caption property to assign a caption to the button. Use the Style or Skin property to change the visual appearance for your button. Use the <img> HTML tag to insert icons inside the button's caption.

The following sample loads the picture from a file:

With Button1
    .Image = "D:\temp\icons\settings.gif"
End With

The following sample assigns the first icon from an ImageList control:

With Button1
    .Images ImageList1.hImageList
    .Image = 1
End With

The following sample assigns a Picture objects:

With Button1
    .Image = Picture1.Picture
End With

The following sample loads the picture from an BASE64 encoded string ( Use the eximages tool to save your picture as base64 encoded format )

The following sample displays the first icon in the Images collection:

 

All of the properties and methods for all objects in the Exontrol's exButton can be assigned at design time using the WYSWYG Template /Layout editor. Open the control in design mode, and select Properties from its context menu. The Template language uses the x-script language ( very simple ), that can be used to initializes the properties and methods at design time.

The following sample initializes the control's image and caption at design mode, using the Template page:

The button's visual appearance in this case will be:


Send comments on this topic.
© 1999-2006 Exontrol Inc, Software. All rights reserved.