Report.FillStyle 属性 (Access)
使用 FillStyle 属性可以指定报表上 由 Circle 或 Line 方法绘制的圆形或 线条 是透明、不透明还是用图案填充。 Integer 型,可读/写。
语法
表达式。FillStyle
表达 一个代表 Report 对象的变量。
备注
FillStyle 属性使用以下设置。
Setting | 说明 |
---|---|
0 | 不透明 |
1 | (默认值)透明 |
2 | 水平线 |
3 | 垂直线 |
4 | 上对角线 |
5 | 下对角线 |
6 | 十字线 |
7 | 对角十字线 |
注意
[!注释] 在由节的 OnPrint 属性设置所指定的事件过程中,可以设置 FillStyle 属性。
当 FillStyle 属性设置为 0 时,圆或线条都有由 FillColor 属性设置的颜色。 当 FillStyle 属性设置为 1 时,圆或线条的内部是透明的为报表的颜色。
若要使用 FillStyle 属性, 特殊效果 属性必须设置为普通。
The following example uses the Circle method to draw a circle and create a pie slice within the circle. 然后,它使用 FillColor 和 FillStyle 属性将饼图切片着色为红色。 它还从左上方到圆心绘制一条线。
示例
若要在 Microsoft Access 中试用这一示例,请先创建一个新的报表。 将“主体”节的 OnPrint 属性设置为 [事件过程]。 在报表模块中输入以下代码,然后切换到“打印预览”。
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
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。