g:background.removeObjects Method

Removes all g:text and g:image elements added to the gadget background using the addTextObject and addImageObject methods.

Syntax

retVal = g:background.removeObjects()

Parameters

This method has no parameters.

Return Value

HRESULT

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The initial background image is unaffected.

Examples

The following example demonstrates how to add both g:text and g:image elements to a g:background and then remove them using the removeObjects method

\\ Add g:text and g:image elements to the g:background element.
\\ imgBackground is the value of the 'id' attribute for the g:background element.
var imgGlow = imgBackground.addImageObject("file://img.png", 0, 0);
var txtShadow = imgBackground.addTextObject("test", "Verdana", 25, "Red", 50, 50);

\\ Remove all text and image elements, leaving the initial background image unchanged.
imgBackground.removeObjects();

See Also

g:background

Reference

image

text

 

 

Send comments about this topic to Microsoft

Build date: 2/24/2010

Build type: SDK