Previous Document Next Document

Object Model Reference : Classes : P : PatternCanvases : Properties : PatternCanvases.Count


PatternCanvases.Count

Property Count As Long

Description

Member of PatternCanvases

The Count property returns the number of pattern canvases available in the PatternCanvases collection.

The Count property returns a read-only value.

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.