Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Development
Gadgets
Windows Sidebar
background
Methods
 background.addTextObject method
background.addTextObject method

[The Windows Gadget Platform/Sidebar is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]

Applies to: desktop apps only

Adds a g:text element to the g:background element.

Syntax

iRetVal = background.addTextObject(
  strText,
  strFont,
  intFontSize,
  strColor,
  intXOffset,
  intYOffset
)

Parameters

strText [in]

A string that specifies the text to be added.

strFont [in]

A string that specifies the font name in which to render the text.

intFontSize [in]

An integer that specifies the absolute value for the point-size in which to render the text. This value is limited to an integer; there are no overload methods that allow the use of alternate HTML-standard values such as absolute sizes (xx-small | x-small | small | medium | large | x-large | xx-large), relative sizes (larger | smaller), percentages, or other length specifications (cm, mm, in, pc, px, em, or ex).

strColor [in]

A string that specifies the color of the text.

intXOffset [in]

An integer specifying the horizontal position of the text relative to the top-left corner of the background.

intYOffset [in]

An integer specifying the vertical position of the image relative to the top-left corner of the background.

Remarks

The default font and size is 12-point Times New Roman if the specified font and size are not available on the system.

Examples

The following example demonstrates how to add text to a gadget background.

\\ imgBackground is the value of the 'id' attribute for the g:background element.
var txtShadow = imgBackground.addTextObject("test", "Verdana", 25, "Red", 50, 50);

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

End of client support

Windows 8 Consumer Preview

End of server support

Windows Server 8 Beta

IDL

Sidebar.idl

DLL

Sidebar.Exe (version 1.00 or later)

See also

Reference
background
text

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Return Value      imess   |   Edit   |   Show History
This function returns the g:text element, not "no return value."
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker