Method XbpTreeViewItem():setExpandedImage() Foundation

Specifies a new image representing the expanded state.

ASSIGN METHOD :setExpandedImage( <nResId> | <oImage> ) --> lSuccess
<nResId> is the numeric resource identifier of a image or icon used to indicate expanded state. 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 image to be displayed 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 expanded image could be updated, otherwise it returns .F. (false).


The method :setExpandedImage() changes the image representing an XbpTreeViewItem object's expanded state. A XbpTreeViewItem is in expanded state if it defines a sub-level of the tree and the sub-level is currently visible. Using method :setExpandedImage(), an item's expanded image can be updated while the object is visible in the tree view. :setExpandedImage() can only be used after the method :create() has been executed.

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

If an XbpBitmap or XbpIcon object is used together with :setExpandedImage(), 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.