Painting Pages and Zones
Take the following steps to add code to the existing project that will let you recognize pages:
1. |
Start with the program you created in Working with Pages. | |
2. |
Add a command button to your form and name it as follows: | |
|
Name |
Caption |
|
DRAWZONES |
Draw Zones |
|
DRAWPAGE |
Draw Page |
3. |
Add the following code to the general declarations section of your project: |
Dim bDrawPage As Boolean
Dim bDrawZones As Boolean
Add the following code to the main form's Load procedure
bDrawPage = False
bDrawZones = False
4. |
Code the DRAWZONES button's click procedure as follows: |
Private Sub DRAWZONES_Click()
bDrawZones = Not bDrawZones
End Sub
5. |
Edit the ADDPAGE procedure, add the following lines after addpage: |
bDrawPage = False
LEADRasterDoc.ActivePageIndex = 0
bDrawPage = True
6. |
Code the DRAWPAGE button's click procedure as follows: |
Private Sub DRAWPAGE_Click()
If (bDrawPage = True) Then
LEADRasterDoc.EnableShowZones = bDrawZones
LEADRasterDoc.DrawPersistence = False
LEADRasterDoc.DrawPageNull, hDC, 0
End If
End Sub
7. |
Run your program to test it. |