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

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

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

FillStyle属性可用于指定圆形或线条的方法在报表上绘制线条是透明、 不透明,或用图案填充。读取/写入的整数You can use the FillStyle property to specify whether a circle or line drawn by the Circle or Line method on a report is transparent, opaque, or filled with a pattern. Read/write Integer.

语法Syntax

表达式FillStyleexpression. FillStyle

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

注解Remarks

FillStyle属性使用以下设置。The FillStyle property uses the following settings.

设置Setting说明Description
00不透明Opaque
11(默认值)透明(Default) Transparent
22水平线Horizontal Line
33垂直线Vertical Line
44上对角线Upward Diagonal
55下对角线Downward Diagonal
66十字线Cross
77对角十字线Diagonal Cross

请注意 在由节的OnPrint属性设置所指定的事件过程中,可以设置FillStyle属性。Note You can set the FillStyle property in an event procedure specified by a section's OnPrint property setting.

FillStyle属性设置为 0 时,圆或线条都有由FillColor属性设置的颜色。当FillStyle属性设置为 1 时,圆或线条的内部是透明的为报表的颜色。When the FillStyle property is set to 0, a circle or line has the color set by the FillColor property. When the FillStyle property is set to 1, the interior of the circle or line is transparent and has the color of the report behind it.

若要使用FillStyle属性,特殊效果属性必须设置为普通。To use the FillStyle property, the SpecialEffect property must be set to Normal.

下面的示例使用Circle方法来画一个圆,并创建一个在这个圆中的扇形。然后它使用*圆心*之间属性的饼图扇区颜色变为红色。它还绘制一条从左上方的圆的中心。The following example uses the Circle method to draw a circle and create a pie slice within the circle. Then it uses the FillColor and FillStyle properties to color the pie slice red. It also draws a line from the upper left to the center of the circle.

示例Example

若要试用该示例,在 Microsoft Access 中的,创建新的报表。请将OnPrint属性设为 [事件过程] 主体节。在报表模块中输入下列代码,然后切换到打印预览。To try this example in Microsoft Access, create a new report. Set the OnPrint property of the Detail section to [Event Procedure]. Enter the following code in the report's module, then switch to Print Preview.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) 

 Const conPI = 3.14159265359 

 Dim sngHCtr As Single 
 Dim sngVCtr As Single 
 Dim sngRadius As Single 
 Dim sngStart As Single 
 Dim sngEnd As Single 

 sngHCtr = Me.ScaleWidth / 2 ' Horizontal center. 
 sngVCtr = Me.ScaleHeight / 2 ' Vertical center. 
 sngRadius = Me.ScaleHeight / 3 ' Circle radius. 
 Me.Circle (sngHCtr, sngVCtr), sngRadius ' Draw circle. 
 sngStart = -0.00000001 ' Start of pie slice. 

 sngEnd = -2 * conPI / 3 ' End of pie slice. 
 Me.FillColor = RGB(255, 0, 0) ' Color pie slice red. 
 Me.FillStyle = 0 ' Fill pie slice. 

 ' Draw Pie slice within circle 
 Me.Circle (sngHCtr, sngVCtr), sngRadius, , sngStart, sngEnd 

 ' Draw line to center of circle. 
 Dim intColor As Integer 
 Dim sngTop As Single, sngLeft As Single 
 Dim sngWidth As Single, sngHeight As Single 

 Me.ScaleMode = 3 ' Set scale to pixels. 
 sngTop = Me.ScaleTop ' Top inside edge. 
 sngLeft = Me.ScaleLeft ' Left inside edge. 
 sngWidth = Me.ScaleWidth / 2 ' Width inside edge. 
 sngHeight = Me.ScaleHeight / 2 ' Height inside edge. 
 intColor = RGB(255, 0, 0) ' Make color red. 

 ' Draw line. 
 Me.Line (sngTop, sngLeft)-(sngWidth, sngHeight), intColor 

End Sub

另请参阅See also

概念Concepts

报表对象Report Object

© 2018 Microsoft