PaintMaxPasses example for Access 2.0

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

Sub Start_Click ()
   Me![LEAD1].Object.AutoRepaint = False
   'Set the Effect
   Me![LEAD1].Object.PaintEffect = EFX_EFFECT_WIPE_L_TO_R
   Me![LEAD1].Object.PaintMaxPasses = 5      '5 total passes
   Me![LEAD1].Object.PaintPass = 1         'Start with pass number 1
   'Load the image
   Me![LEAD1].Object.Load "c:\lead\images\image1.cmp", 0, 0, 1
   Me![LEAD1].Object.ForceRePaint          'Start painting
End Sub

Sub Lead1_PaintNotification (uPass As Integer, uType As Integer)
   'if the first pass is complete
   If ((uType = EFX_NOTIFY_IMAGE) And (uPass > 0)) Then
     'Toggle the effect from left_to_right to right_to_left
     If Me![LEAD1].Object.PaintEffect = EFX_EFFECT_WIPE_L_TO_R Then
       Me![LEAD1].Object.PaintEffect = EFX_EFFECT_WIPE_R_TO_L
     Else
       Me![LEAD1].Object.PaintEffect = EFX_EFFECT_WIPE_L_TO_R
     End If
   End If
End Sub