Method XbpStatic():setCaption() Foundation

Specifies a new caption.

:setCaption( <xCaption>, [<cDll>] ) --> lSuccess
<xCaption> is the character string to be displayed as the caption or it is a numeric value which indicates the resource ID of a BITMAP or icon resource. Alternatively, if the display type of the static object is XBPSTATIC_TYPE_BITMAP or XBPSTATIC_TYPE_ICON, a XbpBitmap or XbpIcon object can be passed to define the caption image. This allows loading images of various image file formats. Furthermore, if a transparent color has been defined for a bitmap object, transparent areas of the image are automatically replaced with the background color defined for the XbpStatic object. <xCaption> must correspond to the display type of an XbpStatic object ( :type) defined when :create() is called.
A character string containing the name of a DLL file. This must be specified if the bitmap or icon for the caption is linked as a resource to a DLL. When the resource is linked to the EXE file, no file name needs to be specified.

This method returns .T. (true) if the caption could be updated, otherwise it returns .F. (false).


The method :setCaption() changes the caption of an XbpStatic object after the method :create() has been executed. The caption can be updated while the object is visible on the screen. However, :setCaption() does not change the display type (text, bitmap, icon) of an XbpStatic object. The methods :destroy() and :create() must be used to change the display type.

Reusing XbpBitmap or XbpIcon objects assigned to the caption of an XbpStatic object is discouraged. For example, if a different image must be loaded to define a caption for another object, then a new XbpBitmap or XbpIcon object should be created instead.


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.