Table of contents
TOC
折叠目录
展开目录

Report.PaletteSource 属性 (访问)Report.PaletteSource Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

可以使用调色板来源属性以指定报表的调色板。读/写,字符串You can use the PaletteSource property to specify the palette for a report. Read/write String.

语法Syntax

表达式调色板expression. PaletteSource

表达式_一个表示报表对象的变量。_expression A variable that represents a Report object.

注解Remarks

输入以下某文件类型的路径和文件名:Enter the path and file name of one of the following file types:

  • .dib(与设备无关的位图文件).dib (device-independent bitmap file)

  • .pal(Windows 调色板文件).pal (Windows palette file)

  • .ico(Windows 图标文件).ico (Windows icon file)

  • .bmp(Windows 位图文件).bmp (Windows bitmap file)

  • .wmf 或 .emf 文件,或其他有相应图形筛选器的图形文件.wmf or .emf file, or other graphics file for which you have a graphics filter

默认设置是“(默认值)”,它指定 Microsoft Access 所包含的调色板。如果通过输入路径及文件名改变该设置,则属性设置将显示“(自定义)”。The default setting is (Default), which specifies the palette included with Microsoft Access. If you change this setting by entering a path and file name, the property setting displays (Custom).

对于报表,您可以设置只能在报表设计视图中的调色板来源属性。该属性设置在其他视图中不可用。For a report, you can set the PaletteSource property only in report Design view. The property setting is unavailable in other views.

Windows 可以只有一个调色板活动一次。Microsoft Access 将允许您在窗体中,每个使用不同的颜色调色板上具有多个图形。调色板PaintPalette属性,可以指定窗体在显示图形所使用的调色板。Windows can have only one color palette active at a time. Microsoft Access allows you to have multiple graphics on a form, each using a different color palette. The PaletteSource and PaintPalette properties let you specify which color palette a form uses when displaying graphics.

设置窗体或报表的调色板来源属性时,Microsoft Access 会自动更新其PaintPalette属性。相反,当窗体或报表的PaintPalette属性设置时,也会更新的调色板来源属性。例如,当您使用PaintPalette属性指定自定义调色板,调色板来源属性设置更改为 (自定义)。(这是仅适用于宏或 Visual Basic) 的PaintPalette属性用于设置窗体或报表的调色板。调色板来源属性使您能够使用现有的图形文件属性表中设置窗体或报表的调色板。When you set the PaletteSource property for a form or report, Microsoft Access automatically updates its PaintPalette property. Conversely, when you set a form's or report's PaintPalette property, the PaletteSource property is also updated. For example, when you specify a custom palette with the PaintPalette property, the PaletteSource property setting changes to (Custom). The PaintPalette property (which is available only in a macro or Visual Basic) is used to set the palette for the form or report. The PaletteSource property gives you a way to set the palette for the form or report in the property sheet by using an existing graphics file.

示例Example

下面的示例将 Seascape 窗体的PaintPalette属性设置为海洋 DisplayPictures 窗体上控件的ObjectPalette属性。(Ocean 可以是绑定的对象框、 命令按钮、 图表、 切换按钮或未绑定的对象框。The following example sets the PaintPalette property of the Seascape form to the ObjectPalette property of the Ocean control on the DisplayPictures form. (Ocean can be a bound object frame, command button, chart, toggle button, or unbound object frame.)

Forms!Seascape.PaintPalette = _ 
 Forms!DisplayPictures!Ocean.ObjectPalette

ObjectPalettePaintPalette属性可用于以编程方式在运行时通过打开的窗体更改颜色调色板中使用。这些属性中的一个常见用途是图形的将当前窗体的PaintPalette属性设置为具有焦点的控件中所显示的调色板。The ObjectPalette and PaintPalette properties are useful for programmatically altering the color palette in use by an open form at run time. A common use of these properties is to set the current form's PaintPalette property to the palette of a graphic displayed in a control that has the focus.

例如,可以让窗体使用海洋图画,蓝色的底纹和日落图片,显示有许多红色底纹。由于 Windows 只允许一个调色板活动一次,一张图片看起来比其它的好得多。下面的示例对窗体的PaintPalette属性设置为控件的ObjectPalette属性,因此具有焦点的图形将具有最佳的外观使用控件的输入事件。For example, you can have a form with an ocean picture, showing many shades of blue, and a sunset picture, showing many shades of red. Since Windows only allows one color palette active at a time, one picture will look much better than the other. The following example uses a control's Enter event for setting the form's PaintPalette property to the control's ObjectPalette property so the graphic that has the focus will have an optimal appearance.

Sub OceanPicture_Enter() 
 Me.PaintPalette = Me!OceanPicture.ObjectPalette 
End Sub 

Sub SunsetPicture_Enter() 
 Me.PaintPalette = Me!SunsetPicture.ObjectPalette 
End Sub

另请参阅See also

概念Concepts

报表对象Report Object

© 2018 Microsoft