API Documentation > CorelDRAW > 2025-v26 > PatternCanvases > IVGPatternCanvases
PatternCanvases.Count property
Gets the number of PatternCanvas in the PatternCanvases collection
Syntax:
Property Get Count() As Long
Remarks:
The Count property returns the number of pattern canvases available in the PatternCanvases collection.
Examples:
The following VBA example creates a sample tile of each available two-color pattern fill.
Sub Test()
Const cx As Long = 8
Const cy As Long = 10
Dim i As Long
Dim nx As Long, ny As Long
Dim x As Double, y As Double
Dim sx As Double, sy As Double
Dim s As Shape
sx = ActivePage.SizeWidth / cx
sy = ActivePage.SizeHeight / cy
nx = 0
ny = 0
For i = 1 To PatternCanvases.Count
  x = nx * sx
  y = ny * sy
  Set s = ActiveLayer.CreateRectangle2(x, y, sx, sy)
  s.Fill.ApplyPatternFill cdrTwoColorPattern, , i
  nx = nx + 1
  If nx >= cx Then

 nx = 0

 ny = ny + 1
  End If
Next i 
End Sub