Method XbpTreeViewItem():setImage() Foundation

Specifies a new image for the tree view item.

ASSIGN METHOD :setImage( <nResId> | <oImage> ) --> lSuccess
<nResId> is the numeric resource identifier of the image or icon displayed by the tree view item object. Resource IDs must be defined in a resource file which is linked to the EXE file. For images, the Resource ID must be the id of a BITMAP resource.
<oImage> is an object of the XbpBitmap or XbpIcon class. If this parameter is used instead of <nResId>, the expanded image is defined by the bitmap or icon object. This in turn allows the usage of various image file formats. Furthermore, if a transparent color has been defined for the bitmap object, transparent areas within the image are automatically replaced with the background color defined for the XbpTreeView object.

This method returns .T. (true) if the tree view item's image could be updated, otherwise it returns .F. (false).


The method :setImage() changes the image assigned to an XbpTreeViewItem object. The image can be updated while the object is visible in the tree view. :setImage() can only be used after the method :create() has been executed.

This method is the ASSIGN method of the member variable :image. It is called automatically whenever a value is assigned to :image. Xbase++ applications need not call this method directly. Instead, the value contained in the :image instance variable should be manipulated. ,

If an XbpBitmap or XbpIcon object is used together with :setImage(), one of the methods :load() or :loadFile() must have previously been called. For bitmaps constructed in memory, method :make() must have been used. Moreover, it is discouraged to use the object to load or define a different image as long as it is assigned to the treeview item. Instead, a new XbpBitmap or XbpIcon object should be created for that purpose.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.