Report.FillStyle 屬性 (Access)

使用 FillStyle 屬性可指定由 Circle 或 Line 方法在報表上繪製的圓形或 條是透明、不透明或填滿圖樣。 可讀寫的 Integer

語法

運算式FillStyle

表達 代表 Report 物件的變數。

註解

FillStyle 屬性使用下列設定值。

設定 描述
0 不透明
1 透明 (預設值)
2 水平線條
3 垂直線條
4 由左下角到右上角的對角線
5 由左上角到右下角的對角線
6 交叉線條
7 交叉的對角線

注意事項

[!注意事項] 您可以在區段的 OnPrint 屬性設定所指定的事件程序中設定 FillStyle 屬性。

FillStyle 屬性設為 0 時,circle 或列有 填滿色彩 屬性所設定的色彩。 當 FillStyle 屬性設為 1 時、 circle 或線條的內部透明而且其後面報表的色彩。

若要使用 FillStyle 屬性, SpecialEffect 屬性必須設為 Normal。

下列範例使用 Circle 方法繪製圓形及圓形內建立圓形圖。 然後,它會使用 FillColorFillStyle 屬性將圓形圖配量設為紅色。 它也會從圓圈的左上角繪製一條線。

範例

若要在 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 支援與意見反應