Method XbpTreeViewItem():setMarkedImage() Foundation

Specifies a new image representing the marked state.

ASSIGN METHOD :setMarkedImage( <nResId> | <oImage ) --> lSuccess
<nResId> is the numeric resource identifier of the image or icon displayed when the tree view item object is marked (selected). 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 marked image is defined by the bitmap or icon object. This in turn allows the usage of images defined in 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 marked image could be updated, otherwise it returns .F. (false).


The method :setMarkedImage() changes the image representing an XbpTreeViewItem object's marked state. Using :setMarkedImage(), an item's marked image can be updated while the object is visible in the tree view. The method can only be used after the method :create() has been executed.

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

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

Windows uses the Windows Bitmap file format as the default image format. If a numeric resource id is assigned to <nResId>, it must be the id of a BITMAP resource linked into the application. In order to define an image of an image file format as the marked image of a tree view item, an XbpBitmap object must be used instead. Also see XbpBitmap:load() for further information.


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.