Partager via


text.color property

[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. ]

Gets or sets the text color.

This property is read/write.

Syntax

strcolor = text.color
text.color = strcolor

Property value

A String that specifies or receives the named Windows color applied to the target element.

Remarks

The Windows Sidebar color names match the Microsoft .NET Framework version 1.0, Windows Forms, and Microsoft Internet Explorer color names. This representation is based on UNIX X11 named color values.

The following image shows each predefined color, its name, and its hexadecimal value.

predefined windows color names

Examples

The following example demonstrates how to assign a color to the g:text element from a gadget script file.

\\ imgBackground is the value of the 'id' attribute for the g:background element.
var txtColor = imgBackground.addTextObject("test", "Verdana", 25, "Red", intX, intY);
txtColor.color = "ForestGreen";

Requirements

Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
End of client support
Windows 7
End of server support
Windows Server 2008
IDL
Sidebar.idl
DLL
Sidebar.Exe (version 1.00 or later)

See also

Reference

background

image

text