TEXT.foregroundColor

[与此页面关联的功能(Windows 媒体播放器 SDK)是旧版功能。 它已被 MediaPlayer 取代。 MediaPlayer 已针对Windows 10和Windows 11进行了优化。 如果可能,Microsoft 强烈建议新代码使用 MediaPlayer 而不是 Windows 媒体播放器 SDK。 如果可能,Microsoft 建议重写使用旧 API 的现有代码以使用新 API。]

foregroundColor 属性指定或检索 Text 控件的文本颜色。

        elementID.foregroundColor

可能的值

此属性是包含任何 Microsoft Internet Explorer 颜色值的读/写 字符串 。 默认值为“black”。

有关演示如何使用 TEXT 元素的属性的示例,请参阅 value 属性。

alphaBlendalphaBlendTo 与未指定 backgroundColorTEXT 元素一起使用时,将使用黑色的背景色。 如果前景色也是黑色 (这是 foregroundColor 属性) 的默认值,则文本可能变得不可读。 若要防止这种情况,请始终指定 backgroundColor 属性,或将 foregroundColor 设置为黑色以外的颜色。

要求

要求
版本
Windows 媒体播放器版本 7.0 或更高版本

另请参阅

AmbientAttributes.alphaBlend

AmbientAttributes.alphaBlendTo

颜色参考

TEXT 元素

TEXT.backgroundColor