Leadtools.WinForms Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
AnimationModeChanged Event
See Also  Example
Leadtools.WinForms Namespace > RasterPictureBox Class : AnimationModeChanged Event



Occurs when the value of the RasterPictureBox.AnimationMode property changes.

Syntax

Visual Basic (Declaration) 
Public Event AnimationModeChanged() As EventHandler
Visual Basic (Usage)Copy Code
Dim instance As RasterPictureBox
Dim handler As EventHandler
 
AddHandler instance.AnimationModeChanged, handler
C# 
public event EventHandler AnimationModeChanged()
C++/CLI 
public:
event EventHandler^ AnimationModeChanged();

Example

This example uses the AnimationModeChanged event to show how the AnimationMode has changed.

Visual BasicCopy Code
Private Sub viewer_AnimationModeChanged(ByVal sender As Object, ByVal e As EventArgs)
    Dim viewer As RasterPictureBox = CType(IIf(TypeOf sender Is RasterPictureBox, sender, Nothing), RasterPictureBox)
    Dim s As String = String.Format("AnimationModeChanged Event: {0}", viewer.AnimationMode.ToString())
    MessageBox.Show(s)
End Sub
Public Sub RasterPictureBox_AnimationModeChanged(ByVal viewer As RasterPictureBox)
    AddHandler viewer.AnimationModeChanged, AddressOf viewer_AnimationModeChanged

    Select Case viewer.AnimationMode
        Case RasterPictureBoxAnimationMode.Infinite
            viewer.AnimationMode = RasterPictureBoxAnimationMode.UseImageGlobalLoop

        Case RasterPictureBoxAnimationMode.UseImageGlobalLoop
            viewer.AnimationMode = RasterPictureBoxAnimationMode.Infinite
    End Select

    viewer.PlayAnimation()
    RemoveHandler viewer.AnimationModeChanged, AddressOf viewer_AnimationModeChanged
End Sub
C#Copy Code
private void viewer_AnimationModeChanged(object sender, EventArgs e) 

   RasterPictureBox viewer = sender as RasterPictureBox; 
   string s = string.Format("AnimationModeChanged Event: {0}", viewer.AnimationMode.ToString()); 
   MessageBox.Show(s); 

public void RasterPictureBox_AnimationModeChanged(RasterPictureBox viewer) 

   viewer.AnimationModeChanged += new EventHandler(viewer_AnimationModeChanged); 
 
   switch (viewer.AnimationMode) 
   { 
      case RasterPictureBoxAnimationMode.Infinite: 
         viewer.AnimationMode = RasterPictureBoxAnimationMode.UseImageGlobalLoop; 
         break; 
 
      case RasterPictureBoxAnimationMode.UseImageGlobalLoop: 
         viewer.AnimationMode = RasterPictureBoxAnimationMode.Infinite; 
         break; 
   } 
 
   viewer.PlayAnimation(); 
   viewer.AnimationModeChanged-= new EventHandler(viewer_AnimationModeChanged); 
}

Remarks

This event is raised if the RasterPictureBox.AnimationMode property is changed by either a programmatic modification or user interaction.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also