返回指定对象的 Theme 对象。
expression.ThemeProperties(PropertyIndex)
expression 返回 PageWindowEx、WebEx 或 WebFile 对象的表达式。
PropertyIndex 可选,FpThemeProperties 常数。返回或设置主题属性。可以是下表中显示的 FpThemeProperties 常数之一。有关下表所示的各个类型常数的详细信息,请参阅 ApplyTheme 方法中的表格与列表。
| FpThemeProperties | 值 | 说明 |
|---|---|---|
| fpThemeActiveGraphics | 16 或 &H10 | 设置或返回活动图形常数。 |
| fpThemeBackgroundImage | 1 | 设置或返回背景图像。 |
| fpThemeCSS | 4096 或 &H1000 | 设置或返回级联样式表。 |
| fpThemeDefaultSettings | 16777216 或 &H1000000 | 返回应用于站点的主题。 |
| fpThemeName | 33554432 或 &H2000000 | 设置或返回 ThemeName 常数。 |
| fpThemeNoBackgroundImage | 0 | 设置或返回无图像的背景。 |
| fpThemeNoCSS | 0 | 如果尚未设置或不需要级联样式表,则设置或返回本属性。 |
| fpThemeNormalColors | 0 | 设置或返回普通颜色的颜色模式。 |
| fpThemeNormalGraphics | 0 | 设置或返回普通图形的图形模式。 |
| fpThemePropertiesAll | 4369 或 &H1111 | 设置或返回所有主题属性。主题应用于对象之后,fpThemePropertiesAll 属性会合并应用于该对象的所有属性。 |
| fpThemePropertiesNone | 0 | 为主题属性设置或返回“无”。 |
| fpThemeVivdColors | 256 | 设置或返回鲜艳颜色属性。 |
下列示例检查动态图形的主题属性。如果已经应用了动态图形,则除了已经应用于活动网页窗口的主题属性以外,还将应用鲜艳颜色。如果没有应用动态图形,则将动态图形与鲜艳颜色同时应用于活动网页窗口。
Private Sub GetThemeProperties()
Dim myPageWindow As PageWindowEx
Set myPageWindow = ActiveWeb.ActiveWebWindow.ActivePageWindow
If myPageWindow.ThemeProperties(fpThemeActiveGraphics) Then
myPageWindow.AppyTheme (fpThemePropertiesAll + _
fpThemeVividColors)
Exit Sub
Else
myPageWindow.ApplyTheme (fpThemePropertiesAll + _
fpThemeActiveGraphics + fpThemeVividColors)
End If
End Sub
下列示例将背景图片添加到指定文件。
Private Sub AddBackgroundImage()
Dim myFile As WebFile
Set myFile = Webs(0).Rootfolder.Files("index.htm")
If myFile.ThemeProperties(fpThemeBackgroundImage) = 0 Then
myFile.ApplyTheme myFile.ThemeProperties(fpThemeName), _
myfile.ThemeProperties(fpThemePropertiesAll) + _
fpThemeBackgroundImage
End If
End Sub